/// <summary> /// Remove all the operations from the collection /// </summary> public void ClearOperation() { _operationLists.Clear(); ImageProperty panel = ImagePropertyPanel; if (panel != null) { panel.SetOperations(_operationLists); } Image = Image; }
public void ActivateOperation(int op_index) { _operationLists[op_index].Active = true; ImageProperty panel = ImagePropertyPanel; if (panel != null) { panel.SetOperations(_operationLists); } Image = Image; }
public void RemoveOperation(int op_index) { _operationLists.RemoveAt(op_index); ImageProperty panel = ImagePropertyPanel; if (panel != null) { panel.SetOperations(_operationLists); } Image = Image; OnOperationListChanged(this, null); }
/// <summary> /// Remove the last added operation /// </summary> public void PopOperation() { if (_operationLists.Count > 0) { _operationLists.RemoveAt(_operationLists.Count - 1); ImageProperty panel = ImagePropertyPanel; if (panel != null) { panel.SetOperations(_operationLists); } Image = Image; } }
/// <summary> /// Push the specific operation to the operation collection /// </summary> /// <param name="operation">The operation to be pushed onto the operation collection</param> public void PushOperation(Operation operation) { _operationLists.Add(operation); ImageProperty panel = ImagePropertyPanel; if (panel != null) { panel.SetOperations(_operationLists); } try { Image = Image; } catch { //if pushing the operation generate exceptions PopOperation(); //remove the operation throw; //rethrow the exception } }
public void InsertOperation(int op_index, Operation operation) { _operationLists.Insert(op_index, operation); ImageProperty panel = ImagePropertyPanel; if (panel != null) { panel.SetOperations(_operationLists); } try { Image = Image; } catch { //if pushing the operation generate exceptions _operationLists.RemoveAt(op_index); //remove the operation throw; //rethrow the exception } OnOperationListChanged(this, null); }