private void AddGraphicsItem(IGraphicBase g) { var text = g as ITextGraphic; var img = g as IImageGraphic; var path = g as IPathGraphic; var li = new ListViewItem(); li.Tag = g; if (text != null) { li.Text = Strings.SymbolGraphicsTextPlaceholder; li.ImageIndex = 0; } else if (path != null) { li.Text = Strings.SymbolGraphicsPathPlaceholder; li.ImageIndex = 1; } else if (img != null) { li.Text = Strings.SymbolGraphicsImagePlaceholder; li.ImageIndex = 2; } lstGraphics.Items.Add(li); }
private void AddGraphicsItem(IGraphicBase g) { var text = g as ITextGraphic; var img = g as IImageGraphic; var path = g as IPathGraphic; var li = new ListViewItem(); li.Tag = g; if (text != null) { li.Text = Strings.SymbolGraphicsTextPlaceholder; li.ImageIndex = 0; } else if (path != null) { li.Text = Strings.SymbolGraphicsPathPlaceholder; li.ImageIndex = 1; } else if (img != null) { li.Text = Strings.SymbolGraphicsImagePlaceholder; li.ImageIndex = 2; } lstGraphics.Items.Add(li); }
/// <summary> /// Scales the position of an item according to the provided xscale and yscale. Can be called with null for the item (in this case nothing happens). /// </summary> /// <param name="o">The graphics object whose position is scaled.</param> /// <param name="xscale">The xscale ratio.</param> /// <param name="yscale">The yscale ratio.</param> /// <param name="zscale">The zscale ratio.</param> public static void ScalePosition(IGraphicBase o, double xscale, double yscale, double zscale) { if (o != null) { var oldP = o.Position; o.Position = new PointD3D((oldP.X * xscale), (oldP.Y * yscale), (oldP.Z * zscale)); } }
public void RemoveGraphicElement(IGraphicBase graphics) { var g = graphics as GraphicBase; if (g != null) { this.Items.Remove(g); } }
public void AddGraphicElement(IGraphicBase graphics) { var g = graphics as GraphicBase; if (g != null) { this.Items.Add(g); } }
void ISimpleSymbolDefinition.RemoveGraphics(IGraphicBase graphics) { var g = graphics as GraphicBase; if (g != null) { this.Graphics.Remove(g); } }
/// <summary> /// Tries to remove a child object of this collection. /// </summary> /// <param name="go">The object to remove.</param> /// <returns> If the provided object is a child object and /// the child object could be removed, the return value is true.</returns> public bool Remove(IGraphicBase go) { // test our own objects for removal (only that that _are_ removable) if (object.ReferenceEquals(go, _axisTitle)) { _axisTitle = null; EhSelfChanged(EventArgs.Empty); return(true); } return(false); }
public bool Remove(IGraphicBase go) { for (int i = 0; i < _axisStyles.Count; ++i) { if (_axisStyles[i] != null && _axisStyles[i].Remove(go)) { return(true); } } return(false); }
/// <summary> /// Tries to remove a child object of this collection. /// </summary> /// <param name="go">The object to remove.</param> /// <returns> If the provided object is a child object and /// the child object could be removed, the return value is true.</returns> public bool Remove(IGraphicBase go) { // test our own objects for removal (only that that _are_ removable) if (object.ReferenceEquals(go, this._axisTitle)) { _axisTitle = null; EhSelfChanged(EventArgs.Empty); return true; } return false; }
private void SetActiveGraphicElement(IGraphicBase g) { _sym.ClearGraphics(); _sym.AddGraphics(g); OnResourceChanged(); }
private void SetActiveGraphicElement(IGraphicBase g) { _sym.ClearGraphics(); _sym.AddGraphics(g); OnResourceChanged(); }
/// <summary> /// Removes the specified graphics object. Derived classes can override this function not only to remove from the collection of graph objects, /// but also from other places were graph objects can be stored, e.g. inside axis styles. /// </summary> /// <param name="go">The graphics object to remove..</param> /// <returns>True if the graph object was removed; otherwise false.</returns> public override bool Remove(IGraphicBase go) { if (_axisStyles.Remove(go)) return true; else return base.Remove(go); }