Inheritance: System.Windows.Forms.UserControl
Beispiel #1
0
        /// <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;
        }
Beispiel #2
0
        public void ActivateOperation(int op_index)
        {
            _operationLists[op_index].Active = true;
            ImageProperty panel = ImagePropertyPanel;

            if (panel != null)
            {
                panel.SetOperations(_operationLists);
            }
            Image = Image;
        }
Beispiel #3
0
        public void RemoveOperation(int op_index)
        {
            _operationLists.RemoveAt(op_index);
            ImageProperty panel = ImagePropertyPanel;

            if (panel != null)
            {
                panel.SetOperations(_operationLists);
            }
            Image = Image;
            OnOperationListChanged(this, null);
        }
Beispiel #4
0
 /// <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;
     }
 }
Beispiel #5
0
        /// <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
            }
        }
Beispiel #6
0
        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);
        }