public JazzPropertyCommand(JazzGraphContainer container, T thing, string property, P newValue, bool extendable) : base(container) { this.mThing = thing; this.mPropName = property; this.mProperty = typeof(T).GetProperty(property); if (this.mProperty == null) { throw new ArgumentException(typeof(T).Name + "." + property + " does not exist or is inaccessible.", "property"); } object oldVal = this.mProperty.GetValue(this.mThing, null); if (typeof(P).IsPrimitive) { this.mOldVal = (P)Convert.ChangeType(oldVal, typeof(P)); } else { this.mOldVal = (P)oldVal; } this.mNewVal = newValue; this.bExtendable = extendable; }
public JazzCommand(JazzGraphContainer container) { if (container == null) { throw new ArgumentNullException("container"); } this.mContainer = container; }
public NameCommand(JazzGraphContainer container, string newName, bool extendable) { this.mContainer = container; this.mOldName = container.mName; this.mNewName = newName; this.bExtendable = extendable; this.SetLabel(); }
public JazzCommand(JazzGraphContainer container, bool groupWithPrevCommand, string label) : base(groupWithPrevCommand, label) { if (container == null) { throw new ArgumentNullException("container"); } this.mContainer = container; }
public bool RemoveJazzGraph(JazzGraphContainer jgc) { if (jgc == null) { return(false); } int index = jgc.Index; for (int i = this.Graphs.Count - 1; i >= 0; i--) { jgc = this.Graphs[i]; if (jgc.Index == index) { this.Graphs.RemoveAt(i); return(true); } } return(false); }