public bool InitializeDocument(params object[] args) { if (args == null || args.Length == 0) return false; if (!(args[0] is G2DPlotItem)) return false; else _doc = _tempdoc = (G2DPlotItem)args[0]; if (args.Length >= 2 && args[1] != null) { if (!(args[1] is PlotGroupStyleCollection)) return false; else _groupStyles = (PlotGroupStyleCollection)args[1]; } else { if(_doc.ParentCollection!=null) _groupStyles = _doc.ParentCollection.GroupStyles; } if(_useDocument==UseDocument.Copy) _tempdoc = (G2DPlotItem)_doc.Clone(); InitializeCollectionAndData(); InitializeStyles(); BringTabToFront(2); return true; }
/// <summary> /// Sets the plot style (or sub plot styles) in this item according to a template provided by the plot item in the template argument. /// </summary> /// <param name="template">The template item to copy the plot styles from.</param> /// <param name="strictness">Denotes the strictness the styles are copied from the template. See <see cref="PlotGroupStrictness" /> for more information.</param> public override void SetPlotStyleFromTemplate(IGPlotItem template, PlotGroupStrictness strictness) { if (!(template is G2DPlotItem) || object.ReferenceEquals(this, template)) { return; } G2DPlotItem from = (G2DPlotItem)template; this._plotStyles.SetFromTemplate(from._plotStyles, strictness); }
protected override void CopyFrom(PlotItem fromb) { base.CopyFrom(fromb); G2DPlotItem from = fromb as G2DPlotItem; if (from != null) { this.Style = from.Style.Clone(); } }
public void CopyFrom(G2DPlotItem from) { CopyFrom((PlotItem)from); }
public G2DPlotItemController(G2DPlotItem doc, PlotGroupStyleCollection parent) { if (!InitializeDocument(doc, parent)) throw new ArgumentException(); }
public G2DPlotItemController(G2DPlotItem doc) : this(doc,null) { }