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

            if (panel != null)
            {
                panel.SetOperations(_operationLists);
            }
            Image = Image;
        }
Example #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);
        }
Example #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;
     }
 }
Example #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
            }
        }
Example #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);
        }