Helper class to perform manipulation of the tree nodes
        internal CopyTaskNodeDecorator(TreeNode root, string srcConnName, string srcSchema, string srcClass, string dstConnName, string dstSchema, string dstClass, string taskName, bool createIfNotExists)
        {
            _node = new TreeNode();
            root.Nodes.Add(_node);

            _node.Nodes.Add(new TreeNode("Description"));
            _node.Nodes.Add(new TreeNode("Options"));
            _node.Nodes.Add(new TreeNode("Property Mappings"));
            _node.Nodes.Add(new TreeNode("Expression Mappings (Right click to add)"));

            this.Name        = taskName;
            this.Description = "Copies features from " + srcClass + " to " + dstClass;

            InitDescription(srcConnName, srcSchema, srcClass, dstConnName, dstSchema, dstClass, createIfNotExists);

            _connMgr = ServiceManager.Instance.GetService <FdoConnectionManager>();

            _srcConnName           = srcConnName;
            _dstConnName           = dstConnName;
            this.CreateIfNotExists = createIfNotExists;

            using (FdoFeatureService srcSvc = GetSourceConnection().CreateFeatureService())
                using (FdoFeatureService dstSvc = GetTargetConnection().CreateFeatureService())
                {
                    ClassDefinition sourceClass = srcSvc.GetClassByName(srcSchema, srcClass);
                    Debug.Assert(sourceClass != null);

                    ClassDefinition targetClass = dstSvc.GetClassByName(dstSchema, dstClass);
                    if (targetClass == null && !this.CreateIfNotExists)
                    {
                        throw new InvalidOperationException("Target class " + dstClass + " does not exist. If you want this class created make sure you checked \"Create class of the name name\" when creating a new copy task");
                    }

                    _srcClass = sourceClass;
                    _dstClass = targetClass;
                }

            _options      = new OptionsNodeDecorator(this, _node.Nodes[1]);
            _propMappings = new PropertyMappingsNodeDecorator(this, _node.Nodes[2]);
            _exprMappings = new ExpressionMappingsNodeDecorator(this, _node.Nodes[3]);

            _node.ExpandAll();
        }
        internal CopyTaskNodeDecorator(TreeNode root, string srcConnName, string srcSchema, string srcClass, string dstConnName, string dstSchema, string dstClass, string taskName, bool createIfNotExists)
        {
            _node = new TreeNode();
            root.Nodes.Add(_node);

            _node.Nodes.Add(new TreeNode("Description"));
            _node.Nodes.Add(new TreeNode("Options"));
            _node.Nodes.Add(new TreeNode("Property Mappings"));
            _node.Nodes.Add(new TreeNode("Expression Mappings (Right click to add)"));

            this.Name = taskName;
            this.Description = "Copies features from " + srcClass + " to " + dstClass;

            InitDescription(srcConnName, srcSchema, srcClass, dstConnName, dstSchema, dstClass, createIfNotExists);

            _connMgr = ServiceManager.Instance.GetService<FdoConnectionManager>();

            _srcConnName = srcConnName;
            _dstConnName = dstConnName;
            this.CreateIfNotExists = createIfNotExists;

            using (FdoFeatureService srcSvc = GetSourceConnection().CreateFeatureService())
            using (FdoFeatureService dstSvc = GetTargetConnection().CreateFeatureService())
            {
                ClassDefinition sourceClass = srcSvc.GetClassByName(srcSchema, srcClass);
                Debug.Assert(sourceClass != null);

                ClassDefinition targetClass = dstSvc.GetClassByName(dstSchema, dstClass);
                if (targetClass == null && !this.CreateIfNotExists)
                    throw new InvalidOperationException("Target class " + dstClass + " does not exist. If you want this class created make sure you checked \"Create class of the name name\" when creating a new copy task");

                _srcClass = sourceClass;
                _dstClass = targetClass;
            }

            _options = new OptionsNodeDecorator(this, _node.Nodes[1]);
            _propMappings = new PropertyMappingsNodeDecorator(this, _node.Nodes[2]);
            _exprMappings = new ExpressionMappingsNodeDecorator(this, _node.Nodes[3]);

            _node.ExpandAll();
        }