using System; using System.Drawing; using System.Drawing.Design; namespace Netron.Diagramming.Core { class ConnectionBaseDescriptor : DiagramEntityBaseDescriptor { #region Constants #endregion #region Fields #endregion #region Properties #endregion #region Constructor /// /// Initializes a new instance of the class. /// /// The provider. /// Type of the object. public ConnectionBaseDescriptor(ConnectionProvider provider, Type objectType) : base(provider, objectType) { AddBaseProperties(); } #endregion #region Methods /// /// Adds the properties of the /// private void AddBaseProperties() { this.AddProperty("From", typeof(Point), constLayout, "The location of the initial connector.", Point.Empty, typeof(UITypeEditor), typeof(Netron.Diagramming.Core.PointConverter)); this.AddProperty("To", typeof(Point), constLayout, "The locationof the end connector.", Point.Empty, typeof(UITypeEditor), typeof(Netron.Diagramming.Core.PointConverter)); } /// /// Override this method to return the appropriate value corresponding to the property /// /// /// protected override void GetValue(object sender, PropertyEventArgs e) { base.GetValue(sender, e); switch (e.Name.ToLower()) { case "to": e.Value = (e.Component as ConnectionBase).To.Point; break; case "from": e.Value = (e.Component as ConnectionBase).From.Point; break; } } #endregion } }