资源简介
C# CAD 画图工具, 可以创建直线、圆弧、鼠标拖拽、undo\redo
代码片段和文件信息
#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 2011-07-25 03:06 DrawTools-master\
文件 81 2011-07-25 03:06 DrawTools-master\.gitignore
目录 0 2011-07-25 03:06 DrawTools-master\DocToolkit\
文件 28000 2011-07-25 03:06 DrawTools-master\DocToolkit\DocManager.cs
文件 2191 2011-07-25 03:06 DrawTools-master\DocToolkit\DocToolkit.csproj
文件 3941 2011-07-25 03:06 DrawTools-master\DocToolkit\DragDropManager.cs
文件 16590 2011-07-25 03:06 DrawTools-master\DocToolkit\MruManager.cs
文件 6401 2011-07-25 03:06 DrawTools-master\DocToolkit\PersistWindowState.cs
目录 0 2011-07-25 03:06 DrawTools-master\DocToolkit\Properties\
文件 1393 2011-07-25 03:06 DrawTools-master\DocToolkit\Properties\AssemblyInfo.cs
目录 0 2011-07-25 03:06 DrawTools-master\DrawTools\
文件 904 2011-07-25 03:06 DrawTools-master\DrawTools\Command.cs
文件 766 2011-07-25 03:06 DrawTools-master\DrawTools\CommandAdd.cs
文件 2399 2011-07-25 03:06 DrawTools-master\DrawTools\CommandChangeState.cs
文件 1639 2011-07-25 03:06 DrawTools-master\DrawTools\CommandDelete.cs
文件 1245 2011-07-25 03:06 DrawTools-master\DrawTools\CommandDeleteAll.cs
文件 1761 2011-07-25 03:06 DrawTools-master\DrawTools\DrawArea.Designer.cs
文件 10241 2011-07-25 03:06 DrawTools-master\DrawTools\DrawArea.cs
文件 5814 2011-07-25 03:06 DrawTools-master\DrawTools\DrawArea.resx
文件 1033 2011-07-25 03:06 DrawTools-master\DrawTools\DrawEllipse.cs
文件 7237 2011-07-25 03:06 DrawTools-master\DrawTools\DrawLine.cs
文件 9054 2011-07-25 03:06 DrawTools-master\DrawTools\Drawob
文件 6625 2011-07-25 03:06 DrawTools-master\DrawTools\DrawPolygon.cs
文件 10248 2011-07-25 03:06 DrawTools-master\DrawTools\DrawRectangle.cs
文件 5882 2011-07-25 03:06 DrawTools-master\DrawTools\DrawTools.csproj
文件 2273 2011-07-25 03:06 DrawTools-master\DrawTools\DrawTriangle.cs
文件 326 2011-07-25 03:06 DrawTools-master\DrawTools\Ellipse.cur
文件 3134 2011-07-25 03:06 DrawTools-master\DrawTools\FrmAbout.Designer.cs
文件 731 2011-07-25 03:06 DrawTools-master\DrawTools\FrmAbout.cs
文件 7730 2011-07-25 03:06 DrawTools-master\DrawTools\FrmAbout.resx
文件 14088 2011-07-25 03:06 DrawTools-master\DrawTools\GraphicsList.cs
............此处省略49个文件信息
相关资源
- c# 全站防止sql注入
- c# 做成数据库生成 nhibernate映射文件程
- c#接收发送can数据
- C# 键盘
- C# 语音 真人语音
- c#实现输入时间,可根据需求选择亮灯
- C#图片移动用Timer+picturebox
- C#银行ATM程序WinForm
- C#大作业源码及课程报告十五子游戏
- VS2017 C# 自动出题器
- 基于凸包多边形的填挖方量计算程序
- C# 计算器 仿windows计算器
- c#上位机数据采集源代码
- C#开发Web留言板功能
-
C#读取xm
l配置文件 - C# 学生管理系统 链接Access数据库
- Asp.net(C#) 创建windows服务并定时执行
- 获取TIMQQ信息.zip
- winform创建不规则窗体和控件源码.ra
- C#截图小工具
- 图像特征点的提取以及同名像点匹配
- c#编写送水管理系统
- C#屏幕截图工具及源码
- 三轴运动控制C#
- 工厂用来测试键盘好坏的的一个软件
- C#贪食蛇全能版
- C# 爬虫接口
- C#网络监控软件代码
- 字符串加密与解密C#源码
- C# Socket 分包传送数据
评论
共有 条评论