资源简介
C# 绘图实例 矩形 椭圆 直线 曲线 带控制点 可撤销 实例
代码片段和文件信息
#region Using directives
using System;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using System.Globalization;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using Microsoft.Win32;
using System.Security;
#endregion
// Using: in the end of this file.
namespace DocToolkit
{
#region Class DocManager
///
/// Document manager. Makes file-related operations:
/// open new save updating of the form title
/// registering of file type for Windows Shell.
/// Built using the article:
/// Creating Document-Centric Applications in Windows Forms
/// by Chris Sells
/// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms09182003.asp
///
public class DocManager
{
#region Events
public event SaveEventHandler SaveEvent;
public event LoadEventHandler LoadEvent;
public event OpenFileEventHandler OpenEvent;
public event EventHandler ClearEvent;
public event EventHandler DocChangedEvent;
#endregion
#region Members
private string fileName = ““;
private bool dirty = false;
private Form frmOwner;
private string newDocName;
private string fileDlgFilter;
private string registryPath;
private bool updatetitle;
private const string registryValue = “Path“;
private string fileDlgInitDir = ““; // file dialog initial directory
#endregion
#region Enum
///
/// Enumeration used for Save function
///
public enum SaveType
{
Save
SaveAs
}
#endregion
#region Constructor
///
/// Initialization
///
///
public DocManager(DocManagerData data)
{
frmOwner = data.FormOwner;
frmOwner.Closing += OnClosing;
updatetitle = data.Updatetitle;
newDocName = data.NewDocName;
fileDlgFilter = data.FileDialogFilter;
registryPath = data.RegistryPath;
if (!registryPath.EndsWith(“\\“))
registryPath += “\\“;
registryPath += “FileDir“;
// attempt to read initial directory from registry
RegistryKey key = Registry.CurrentUser.OpenSubKey(registryPath);
if (key != null)
{
string s = (string)key.GetValue(registryValue);
if (!Empty(s))
fileDlgInitDir = s;
}
}
#endregion
#region Public functions and Properties
///
/// Dirty property (true when document has unsaved changes).
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2007-01-21 21:27 DrawTools2005\
目录 0 2007-01-21 21:27 DrawTools2005\DocToolkit\
文件 28000 2007-01-12 16:46 DrawTools2005\DocToolkit\DocManager.cs
文件 2191 2007-01-12 16:52 DrawTools2005\DocToolkit\DocToolkit.csproj
文件 3941 2007-01-12 16:50 DrawTools2005\DocToolkit\DragDropManager.cs
文件 16590 2007-01-12 16:47 DrawTools2005\DocToolkit\MruManager.cs
文件 6401 2007-01-12 16:52 DrawTools2005\DocToolkit\PersistWindowState.cs
目录 0 2007-01-21 21:26 DrawTools2005\DocToolkit\Properties\
文件 1393 2007-01-12 16:44 DrawTools2005\DocToolkit\Properties\AssemblyInfo.cs
目录 0 2007-01-21 21:27 DrawTools2005\DrawTools\
文件 904 2007-01-20 20:50 DrawTools2005\DrawTools\Command.cs
文件 766 2007-01-13 19:21 DrawTools2005\DrawTools\CommandAdd.cs
文件 2399 2007-01-16 21:48 DrawTools2005\DrawTools\CommandChangeState.cs
文件 1700 2007-01-16 21:32 DrawTools2005\DrawTools\CommandDelete.cs
文件 1245 2007-01-16 21:32 DrawTools2005\DrawTools\CommandDeleteAll.cs
文件 10149 2007-01-20 09:31 DrawTools2005\DrawTools\DrawArea.cs
文件 1761 2007-01-13 17:36 DrawTools2005\DrawTools\DrawArea.Designer.cs
文件 5814 2007-01-13 10:26 DrawTools2005\DrawTools\DrawArea.resx
文件 1033 2007-01-14 20:22 DrawTools2005\DrawTools\DrawEllipse.cs
文件 7237 2007-01-14 20:22 DrawTools2005\DrawTools\DrawLine.cs
文件 9054 2007-01-14 21:08 DrawTools2005\DrawTools\Drawob
文件 6625 2007-01-14 20:21 DrawTools2005\DrawTools\DrawPolygon.cs
文件 10248 2007-01-14 20:22 DrawTools2005\DrawTools\DrawRectangle.cs
文件 5716 2007-01-16 21:32 DrawTools2005\DrawTools\DrawTools.csproj
文件 326 2007-01-13 11:43 DrawTools2005\DrawTools\Ellipse.cur
文件 731 2007-01-13 17:37 DrawTools2005\DrawTools\FrmAbout.cs
文件 3134 2007-01-13 11:54 DrawTools2005\DrawTools\FrmAbout.Designer.cs
文件 7730 2007-01-13 11:54 DrawTools2005\DrawTools\FrmAbout.resx
文件 14088 2007-01-19 21:02 DrawTools2005\DrawTools\GraphicsList.cs
文件 916 2007-01-13 17:37 DrawTools2005\DrawTools\GraphicsProperties.cs
目录 0 2007-01-21 21:26 DrawTools2005\DrawTools\Images\
............此处省略43个文件信息
相关资源
- C#Socket编程.rar
- C#_winform_多个窗体之间相互传递数据操
- C#_winform_DataGridView_checkbox复选框_实现
- C#上的echarts的
- C#实时检测USB设备的插拔并响应各个事
- C#围棋程序
- C#数据表格控件的应用数据库插入删除
- asp.net留言簿实验报告
- c#控制Visio画图
- C# 写的哈夫曼编码译码图形界面
- asp.net网站注册登录功能源码基于C#
- wpf 漂亮Treeview
- asp.net实现的网络教学平台源代码+数据
- c#对图像实现高斯滤波带阻滤波源码
- (源代码)C# Socket服务器和Tcp客户端
- C#图像分割
- 基于C#语言的导线测量程序(对话框)
- C#客户管理源代码
- c#串口通讯log存储及实时波形绘制代码
- Halcon生成的计算圆心C#代码
- C#局域网语音聊天点对点
- asp.net中用C#写的在线考试系统
- C# CRC 循环冗余校验算法
- C#网上招聘系统 源码
- CLR via C# 最新 中文完整版 高清
- C# 打印设置小票打印收银打印
- .net c# 考试系统
- 生产管理系统 (VS2008 C# winform )
- 中英文切换
- C# DataGridView单元格中动态添加多个控
评论
共有 条评论