protected override void Execute(bool isRedo) { oldColor = Node.Color; Node.ChangeColor(newColor); if (isRedo) { Node.Select(); } }
public static void ChangeColorTransactional(this NodeBase node, INodeColor color) { if (node.Document != null && !Equals(node.Color, color) && color != null) { var transactionName = LocalizationManager.GetString("TransactionName_ChangeColor"); node.Document.MakeTransaction(transactionName, commands => { commands.Apply(new ChangeColorCommand(node, color)); }); } }
public ChangeColorCommand(NodeBase node, INodeColor newColor) : base(node) { this.newColor = newColor; }
public ChangeColorCommand(PropertiesBag properties, Document document) : base(properties, document) { newColor = ThemeColor.TryParse(properties) ?? ValueColor.TryParse(properties); }
public bool Equals(INodeColor other) { return(Equals(other as ValueColor)); }
internal void ChangeColor(INodeColor newColor) { Color = newColor; }