public bool Apply()
        {
            if (!this.m_bDirty)
            {
                return(true);     // not dirty - so no need to apply something
            }
            _originalDoc.Clear(); // first, clear all Plot items
            TransferTreeToDoc(_plotItemsRootNode, _originalDoc);

            if (_useDocument == UseDocument.Copy)
            {
                _doc = _originalDoc.Clone();
            }
            SetElements(true); // Reload the applied contents to make sure it is synchronized

            return(true);      // all ok
        }
        /// <summary>
        /// Initialize the controller with the document. If successfull, the function has to return true.
        /// </summary>
        /// <param name="args">The arguments neccessary to create the controller. Normally, the first argument is the document, the second can be the parent of the document and so on.</param>
        /// <returns>True if successfull, else false.</returns>
        public bool InitializeDocument(params object[] args)
        {
            if (args == null || args.Length == 0)
            {
                return(false);
            }
            _doc = _originalDoc = args[0] as PlotItemCollection;
            if (null == _originalDoc)
            {
                return(false);
            }

            if (_useDocument == UseDocument.Copy)
            {
                _doc = _originalDoc.Clone();
            }

            _plotItemsTree = _plotItemsRootNode.Nodes;
            SetElements(true);
            return(true);
        }
    /// <summary>
    /// Initialize the controller with the document. If successfull, the function has to return true.
    /// </summary>
    /// <param name="args">The arguments neccessary to create the controller. Normally, the first argument is the document, the second can be the parent of the document and so on.</param>
    /// <returns>True if successfull, else false.</returns>
    public bool InitializeDocument(params object[] args)
    {
      if (args == null || args.Length == 0)
        return false;
      _doc = _originalDoc = args[0] as PlotItemCollection;
      if (null == _originalDoc)
        return false;

      if (_useDocument == UseDocument.Copy)
        _doc = _originalDoc.Clone();

      _plotItemsTree = _plotItemsRootNode.Nodes;
      SetElements(true);
      return true;
    }