/// <summary> /// Initializes a new instance of the <see cref="T:FillStyleCommand"/> class. /// </summary> /// <param name="controller">The controller.</param> /// <param name="bundle">The bundle.</param> /// <param name="paintStyle">The paint style.</param> public FillStyleCommand(IController controller, CollectionBase<IDiagramEntity> bundle, IPaintStyle paintStyle) : base(controller) { this.Text = "Fill style"; this.controller = controller; this.bundle = bundle;//the bundle should contain only IShape and IConnection entities! this.newStyle = paintStyle; }
// ------------------------------------------------------------------ /// <summary> /// Constructor. /// </summary> /// <param name="paintStyle">IPaintStyle: The IPaintStyle that /// changed.</param> /// <param name="newFillType">FillType: The new fill type.</param> // ------------------------------------------------------------------ public PaintStyleChangedEventArgs( IPaintStyle paintStyle, FillType newFillType) { mPaintStyle = paintStyle; mFillType = newFillType; }
/// <summary> /// Changes the paint style of the selected entities /// </summary> /// <param name="paintStyle"></param> public void ChangeStyle(IPaintStyle paintStyle) { //note that you need a copy of the selected item otherwise the undo/redo will fail once the selection has changed FillStyleCommand cmd = new FillStyleCommand(this, Selection.SelectedItems.Copy(), paintStyle); this.UndoManager.AddUndoCommand(cmd); cmd.Redo(); }
/// <summary> /// Initializes a new instance of the <see cref="T:FillStyleCommand"/> class. /// </summary> /// <param name="controller">The controller.</param> /// <param name="bundle">The bundle.</param> /// <param name="paintStyle">The paint style.</param> public FillStyleCommand(IController controller, CollectionBase <IDiagramEntity> bundle, IPaintStyle paintStyle) : base(controller) { this.Text = "Fill style"; this.controller = controller; this.bundle = bundle;//the bundle should contain only IShape and IConnection entities! this.newStyle = paintStyle; }
/// <summary> /// Changes the paint style of the selected entities /// </summary> /// <param name="paintStyle"></param> public void ChangeStyle(IPaintStyle paintStyle) { //note that you need a copy of the selected item otherwise the undo/redo will fail once the selection has changed FillStyleCommand cmd = new FillStyleCommand(this, Selection.SelectedItems.Copy(), paintStyle); this.UndoManager.AddUndoCommand(cmd); cmd.Redo(); }
/// <summary> /// Changes the paint style of the selected entities. /// </summary> /// <param name="paintStyle">The paint style.</param> public void ChangeStyle(IPaintStyle paintStyle) { this.Controller.ChangeStyle(paintStyle); }
/// <summary> /// Changes the paint style of the selected entities. /// </summary> /// <param name="paintStyle">The paint style.</param> public void ChangeStyle(IPaintStyle paintStyle) { this.Controller.ChangeStyle(paintStyle); }