精通
英语
和
开源
,
擅长
开发
与
培训
,
胸怀四海
第一信赖
锐英源精品开源心得,转载请注明:“锐英源www.wisestudy.cn,孙老师作品,电话13803810136。需要全文内容也请联系孙老师。
Many years ago, when Microsoft .NET was newly released, I was working in a company as Software Consultant and I was in duty of helping our customers to jump start .net development and teach them the new .net programming languages C# and Visual Basic .NET in a condensed and structured way. Most of the developers I assisted were Visual Basic 6.0 developers and many of them were not very familiar with Object Oriented Programming and Design. I needed to find the best way to explain OOP. So, the best example to teach OPP was to use a base Shape class having a virtual Draw method and decorate this Shape class with all aspects of OOP. Next to this, I was also teaching them the design time features of Visual Studio .NET. After these workshops were completed and everyone in the world learned .NET, I had lots of shapes beside me; I decided to make something useful with them, which maybe would be useful to others. Thus, I developed a shape-development tool and a development environment that integrates with Visual Studio .NET.
许多年前,当Microsoft .NET发布的时候,我在一个公司作软件顾问并且义务帮助我们的客户启动.NET开发,并教给他们新的.NET编程语言、C#和Visual Basic .NET中的扼要内容和结构化的方式。我协助大多数开发人员开发Visual Basic 6.0,他们中的许多人并不十分熟悉面向对象的编程和设计。我需要找到最好的方法来解释OOP。教OPP最好的例子是使用一个基本图元类有一个虚拟绘制方法和装饰,这个图元类要有OOP的方方面面。接下来,我也教他们Visual Studio . net的设计时的特性。在这些教学完成后。世界上每个人都了解.net,我有很多的图形在我身边,我决定做一些有用的东西,这也许会对其他人有用。因此,我开发了一个图元开发工具并且集成到Visual Studio. net的开发环境。
After I started to work as a Software Architect for various companies in Germany in year 2004 and I had more responsibilities during my work life, I totally forgot that I developed this tool. Just recently, when I was looking to my file archives, I saw it again. I refreshed and updated it now that it also works with newer versions of Visual Studio .NET including Visual Studio 2008, 2010 and 2012. I hope you will like it. It is free and you can download the full source code on http://visualdrawingdotnet.codeplex.com and find the documentation under www.erdalhalici.com.
2004年我开始在德国工作后作为各公司软件架构师,在我的工作生活中我有更多的责任,我完全忘了开发这个工具。就在最近,我寻找我的文件档案的时候,我又看到了。我刷新它,现在,它也适用于Visual Studio .NET的新版本,包括Visual Studio 2008中,2010年和2012。我希望你能喜欢它。它是免费的,你可以在http://visualdrawingdotnet.codeplex.com上下载完整源代码,在www.erdalhalici.com中有文档。
Note: I developed Visual Drawing.Net only for fun, meaning it is not fully documented. But I tried my best. I will continue on documentation as much as I find time to do it, 注意:我开发了Visual Drawing.Net只为了好玩,这意味着它不能完全记录。但我尽力了。我将继续找时间去做它,
Visual Drawing.Net is a shape-development tool providing a development environment that integrates with Visual Studio .NET 2005/2008/2010/20012 and all related express editions. Visual Drawing.Net 是开发图元的工具,提供了与Visual Studio .NET2005/2008/2010/20012和所有相关的速成版集成的开发环境。
Visual Drawing.Net speeds up the development of graphical applications based on the vector graphics. All the shapes that are created using Visual Drawing.Net are programmable and their attributes and properties can be changed at any time during the run time of the containing application. Shapes are designed using object oriented programming paradigm supporting visual inheritance in the Visual Studio .NET 2005/2008/2010/2012 and all Express editions development environment.
Visual Drawing.Net基于矢量图形加速开发图形应用程序。所有使用Visual Drawing.Net 创建的图元是可编程的,它们的属性和性能在包含应用程序的运行时随时可以改变。图元采用面向对象的编程范式在Visual Studio.NET2005/2008/2010/2012和所有速成版的开发环境支持可视化继承设计。
Visual Drawing.Net is a shape-based drawing tool a wealth of built-in shapes that developers can drag onto the drawing surface to create drawings; many third-party tools for use in Visual Studio .NET are available as well. Sometimes, however, when no built-in or third-party shapes exist to solve a specific drawing problem, a shape developer must create custom shapes that have a particular appearance or behave in a certain way at any time. Once created, custom shapes become reusable components that can be used in applications or compiled into shape libraries to be used in the applications. The capacity to use programmable shapes is one of the features that make Visual Drawing.Net such a powerful drawing tool.
Visual Drawing.Net是一个基于图元的绘图工具,丰富了内置的图元,开发人员可以拖到绘图表面创建图纸;许多第三方工具使用Visual Studio .NET是可用的。然而有时,,当不存在内置的或第三方的图元来解决一个特定的图纸问题,开发人员必须创建自定义图元,图元有特定的外观或在任何时候以某种方式表现。一旦创建,自定义图元变成可重用的组件,可以用于应用程序或编译成图元库在应用程序中使用。使用可编程的图元能力是Visual Drawing.Net这样一个强大的绘图工具的特性之一。
Some of the reasons for using Visual Drawing.Net to develop shapes are as follows: 使用Visual Drawing.Net开发图元的原因如下:
•Visual Drawing.Net is a development and productivity tool for developers who design and develop graphical applications. It provides a custom work environment that integrates with Visual Studio .NET 2003 and Visual Studio .NET 2005 and all Express editions to make it easier to specify, create, build, test, and maintain shapes. Visual Drawing.Net是一个开发设计和图形应用程序的开发工具。它提供了与Visual Studio .NET2003和Visual Studio .NET2005和所有速成版集成,使其更容易指定,创建,构建,测试和维护图元。
•Shapes are extendable. You can create your own shape by overriding the shape method MakePath and ones a Shape created, it can be used in the Shape Container. The Shape Container will provide design time support for your shape to rotate, shear, move, warp, shade, fill with a color or using a brush etc. 图元是可扩展的。您可以通过重写MakePath方法和创建一个图元创建自己的图元,它可以用于图元容器里。图元容器将提供设计时支持你的图元旋转,剪切,移动,变形,阴影,填色或使用刷子等。
•Visual Drawing.Net provides consistency in newly developed shapes. You could implement the same behavior in a variety of ways in the Shape Containers (for example, by using visual inheritance in all Visual Studio .NET and Express Editions). With Visual Drawing.Net, behaviors are applied the same way every time. Visual Drawing.Net在最新的开发图元中提供了一致性。你可以以多种方式在图元容器中实现相同的行为(例如,在所有Visual Studio .NET和速成版使用可视化继承)。使用Visual Drawing.Net行为每次应用相同的方式。
Use Visual Drawing.Net, when you want to do any of the following: 当你想到做下列这些的时候使用Visual Drawing.Net:
•Create programmable shapes that have complex attributes and behaviors, such as multi-state shapes. 创建复杂属性和行为的可编程图元,如多态图元。
•Create shapes that are part of a hierarchy of similar shapes or sets of shapes that have minor variations. 创建一个一部分层次结构类似的图元或设置有微小变化的图元。
•Create libraries of shapes and maintain them over time, including making changes to numerous shapes at the same time. 创建图元库并且随着时间的推移维护他们,包括在同一时间更改许多图元。
•Be able to test shapes you have developed to ensure they implement specified behaviors correctly. 能够测试图形开发,以确保他们正确地实现指定的行为。
•Store shape information independently rather than in the applications in which the shapes are used. 独立存储图元信息,而不是在应用程序中使用的图元。
1.In Solution Explorer, select a target project and add a new class in your project. 在解决方案资源管理器中,选择一个目标项目,在项目中添加一个新类。
2.Inherit your newly added class from Camalon.Drawing.ShapeContainer class and add designer required method InitializeComponent as described below:
从Camelon.Drawing.ShapeContainer类继承新添加的类,并添加设计器需要的InitializeComponent方法如下所述::Note Instead of adding a Class, you can add a new Component in your project and then inherit it from Camalon.Drawing.ShapeContainer class as shown below. Thus, all Shape Container Designer required code would be generated automatically. 注意,,您可以在您的项目中添加一个新组件,而不是添加一个类然后从Camalon.Drawing.ShapeContainer类继承它。如下所示。因此,所有图元容器设计器所需的代码将自动生成。
[System.ComponentModel.ToolboxItem(true)] public class MyShapeContainer:Camalon.Drawing.ShapeContainer { public MyShapeContainer() { //This call is required by the Shape Container Designer InitializeComponent(); } //Required method for Designer support - do not modify //the contents of this method with the code editor. private void InitializeComponent() { } }
End Class •Add a custom tab to the Toolbox 最后•自定义选项卡添加到工具箱<System.ComponentModel.ToolboxItem(True)> _ Public Class MyShapeContainer Inherits Camalon.Drawing.ShapeContaine
Public Sub New() 'This call is required by the Shape Container Designer InitializeComponent() End Sub
'Required method for Designer support - do not modify
'the contents of this method with the code editor.
Private Sub InitializeComponent()
End Sub
1.Right-click on any existing tab in the Toolbox and choose Add Tab from its shortcut menu. The new tab appears at the bottom of the Toolbox window, with the Pointer tool automatically added. 右键单击工具箱中的任何现有的选项卡并选择快捷菜单添加选项卡。新标签页出现在工具箱窗口的底部,与指针工具自动添加。
2.In the text box at the bottom of the Toolbox, type a name for the new tab and then press ENTER.在工具箱的底部的文本框,输入一个新标签的名称,然后按ENTER。
Note If you already have a custom tab in your ToolBox that you want to use, ignore this step. 注意如果你已经有一个自定义选项卡在使用你的工具箱,忽略这一步。
•Add Shapes and shape decorators (ShapeBrush, ShapePen etc.) on your Toolbox tab •在你的工具箱选项卡添加图元和图元修饰符(ShapeBrush ShapePen等等)
1.On the Tools menu, choose Add/Remove Toolbox Items. The Customize Toolbox dialog box opens.在工具菜单上,选择添加/删除工具箱项。定制工具箱对话框打开。
2.In the Customize Toolbox dialog box, click from tab to tab to browse through available categories of Toolbox items. 在定制工具箱对话框中,在选项卡里切换找可用的类别的工具箱项。
3.Click Browse to add the Shapes and painting tools not available on the current list. To do this, locate the Camalon.Drawing.dll.单击Browse添加在当前列表里没有的图元和绘画工具。要做到这一点,找到Camalon.Drawing.dll。
4.Click OK to close the Customize Toolbox dialog box. The Shapes and painting tools are added to the tab currently selected in the Toolbox. From there, you can drag and drop Shapes and painting tools in your Shape Container.单击OK关闭定制工具箱对话框。图元和绘画工具被添加到标签当前在工具箱中选择。从那里,您可以拖放图元和绘画工具在你的图元的容器。