コード例 #1
0
 /// <summary>
 /// Override this method to set the appropriate value corresponding to the property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void SetValue(object sender, PropertyEventArgs e) {
   switch (e.Name) {
     default:
       base.SetValue(sender, e);
       break;
   }
 }
コード例 #2
0
 /// <summary>
 /// Override this method to return the appropriate value corresponding to the property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void GetValue(object sender, PropertyEventArgs e) {
   switch (e.Name) {
     case "Demo":
       e.Value = 123456;
       break;
     default:
       base.GetValue(sender, e);
       break;
   }
 }
コード例 #3
0
 protected override void GetValue(object sender, PropertyEventArgs e) {
   switch (e.Name) {
     case "BackColor":
       e.Value = (e.Component as DiagramControlBase).BackColor;
       break;
     default:
       base.GetValue(sender, e);
       break;
   }
 }
コード例 #4
0
 protected override void GetValue(object sender, PropertyEventArgs e) {
   switch (e.Name) {
     case "Materials":
       e.Value = (e.Component as ComplexShapeBase).Children;
       break;
     default:
       base.GetValue(sender, e);
       break;
   }
 }
コード例 #5
0
 /// <summary>
 /// Override this method to set the appropriate value corresponding to the property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void SetValue(object sender, PropertyEventArgs e)
 {
     switch (e.Name.ToLower())
     {
         case "name":
             (e.Component as DiagramEntityBase).Name = (string)e.Value;
             break;
         case "tag":
             (e.Component as DiagramEntityBase).Tag = (object) e.Value;
             break;
     }
 }
コード例 #6
0
        /// <summary>
        /// Override this method to return the appropriate value corresponding to the property
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        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;

            }
        }
コード例 #7
0
    /// <summary>
    /// Override this method to set the appropriate value corresponding to the property
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected override void SetValue(object sender, PropertyEventArgs e) {
      base.SetValue(sender, e);

      switch (e.Name.ToLower()) {
        case "width":
          (e.Component as ShapeBase).Width = (int)e.Value;
          break;
        case "height":
          (e.Component as ShapeBase).Height = (int)e.Value;
          break;
        case "location":
          Point p = (Point)e.Value;
          (e.Component as ShapeBase).Location = new Point(p.X, p.Y);
          break;
      }
    }
コード例 #8
0
        /// <summary>
        /// Override this method to return the appropriate value corresponding to the property
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override void GetValue(object sender, PropertyEventArgs e)
        {
            base.GetValue(sender, e);
            switch (e.Name.ToLower())
            {
                case "width":
                    e.Value = (e.Component as ShapeBase).Width;
                    break;
                case "height":
                    e.Value = (e.Component as ShapeBase).Height;
                    break;
                case "location":
                    e.Value = (e.Component as ShapeBase).Location;
                    break;

            }
        }
コード例 #9
0
    /// <summary>
    /// Override this method to return the appropriate value corresponding to the property
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected override void GetValue(object sender, PropertyEventArgs e) {
      switch (e.Name.ToLower()) {
        case "entity name":
          e.Value = (e.Component as DiagramEntityBase).EntityName;
          break;
        case "name":
          e.Value = (e.Component as DiagramEntityBase).Name;
          break;
        case "rectangle":
          e.Value = (e.Component as DiagramEntityBase).Rectangle;
          break;
        case "scene index":
          e.Value = (e.Component as DiagramEntityBase).SceneIndex;
          break;
        case "tag":
          e.Value = (e.Component as DiagramEntityBase).Tag;
          break;
      }


    }
コード例 #10
0
 /// <summary>
 /// Override this method to set the appropriate value corresponding to the property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void SetValue(object sender, PropertyEventArgs e) {
   switch (e.Name) {
     case "Title":
       (e.Component as ClassShape).Title = e.Value as string;
       break;
     case "SubTitle":
       (e.Component as ClassShape).SubTitle = e.Value as string;
       break;
     case "FreeText":
       (e.Component as ClassShape).FreeText = e.Value as string;
       break;
     case "BodyType":
       (e.Component as ClassShape).BodyType = (BodyType)Enum.Parse(typeof(BodyType), e.Value.ToString());
       break;
     case "Folders":
       (e.Component as ClassShape).Folders = e.Value as CollectionBase<FolderMaterial>;
       break;
     default:
       base.SetValue(sender, e);
       break;
   }
 }
コード例 #11
0
 /// <summary>
 /// Override this method to return the appropriate value corresponding to the property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected override void GetValue(object sender, PropertyEventArgs e) {
   switch (e.Name) {
     case "Title":
       e.Value = (e.Component as ClassShape).Title;
       break;
     case "SubTitle":
       e.Value = (e.Component as ClassShape).SubTitle;
       break;
     case "FreeText":
       e.Value = (e.Component as ClassShape).FreeText;
       break;
     case "BodyType":
       e.Value = (e.Component as ClassShape).BodyType;
       break;
     case "Folders":
       e.Value = (e.Component as ClassShape).Folders;
       break;
     default:
       base.GetValue(sender, e);
       break;
   }
 }
コード例 #12
0
    /// <summary>
    /// When overridden in a derived class, gets the current value of the property on a component.
    /// </summary>
    /// <param name="component">The component with the property for which to retrieve the value.</param>
    /// <returns>
    /// The value of a property for a given component.
    /// </returns>
    public override object GetValue(object component) {
      // Have the property bag raise an event to get the current value
      // of the property.

      PropertyEventArgs e = new PropertyEventArgs(component, base.Name, null);
      RaiseOnGetValue(e);
      return e.Value;
    }
コード例 #13
0
    /// <summary>
    /// When overridden in a derived class, sets the value of the component to a different value.
    /// </summary>
    /// <param name="component">The component with the property value that is to be set.</param>
    /// <param name="value">The new value.</param>
    public override void SetValue(object component, object value) {
      // Have the property bag raise an event to set the current value
      // of the property.

      PropertyEventArgs e = new PropertyEventArgs(component, Name, value);
      RaiseOnSetValue(e);
    }
コード例 #14
0
 /// <summary>
 /// Raises the on set value.
 /// </summary>
 /// <param name="e">The <see cref="T:Netron.Diagramming.Core.PropertyEventArgs"/> instance containing the event data.</param>
 private void RaiseOnSetValue(PropertyEventArgs e) {
   EventHandler<PropertyEventArgs> handler = OnSetValue;
   if (handler != null)
     handler(this, e);
 }
コード例 #15
0
 /// <summary>
 /// Override this method to set the appropriate value corresponding to the property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void SetValue(object sender, PropertyEventArgs e)
 {
 }
コード例 #16
0
 /// <summary>
 /// Override this method to set the appropriate value corresponding to the property
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void SetValue(object sender, PropertyEventArgs e)
 {
 }