Click here to Skip to main content
15,895,011 members
Articles / Programming Languages / C#

Drawing Component to build GIS and CAM applications

Rate me:
Please Sign up or sign in to vote.
4.72/5 (14 votes)
21 Nov 20055 min read 107.9K   8K   123  
An object oriented drawing component for building GIS and CAM applications with multiple views of geometrical model, multiple resolution handling, layers, optimized graphics and more.
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using System.ComponentModel.Design;
using System.Drawing.Design;

namespace WorkSpace
{

	public class VisiPropertyEditor : System.Drawing.Design.UITypeEditor 
	{
		private IWindowsFormsEditorService edSvc = null;
		
		public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) 
		{
			//MessageBox.Show("EditValue");
			VisiEditableProperty vv = null;
			if (context != null
				&& context.Instance != null
				&& provider != null) 
			{
				edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

				if (edSvc != null) 
				{
					//MessageBox.Show("EditValue 1");
					vv = (VisiEditableProperty)value;
					edSvc.DropDownControl(vv.createControl());
										
				}
			}
			
			//value = vv;
			return vv;
		}

		public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context) 
		{
			if (context != null && context.Instance != null) 
			{
				return UITypeEditorEditStyle.DropDown;
			}
			return base.GetEditStyle(context);
		}
	}

	/// <summary>
	/// Summary description for VisiEditableProperty.
	/// </summary>
	public class VisiEditableProperty
	{
		public VisiEditableProperty()
		{			
		}
		
		public virtual Control createControl()
		{
			return new Control();
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Canada Canada
Baranovsky Eduard has been a software developer for more then 10 years. He has an experence in image processing, computer graphics and distributed systems design.

Comments and Discussions