/// <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; } }
/// <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; } }
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; } }
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; } }
/// <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; } }
/// <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; } }
/// <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; } }
/// <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; } }
/// <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; } }
/// <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; } }
/// <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; } }
/// <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; }
/// <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); }
/// <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); }
/// <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) { }