GetTargetConnection() 개인적인 메소드

private GetTargetConnection ( ) : FdoConnection
리턴 FdoToolbox.Core.Feature.FdoConnection
예제 #1
0
        internal OptionsNodeDecorator(CopyTaskNodeDecorator parent, TreeNode optionsNode)
        {
            Parent = parent;
            _node  = optionsNode;

            InitContextMenus();

            //Options - Delete Target
            TreeNode delTargetNode = new TreeNode("Delete Target");

            delTargetNode.ToolTipText      = "Delete all features on the feature class before copying (true: enabled, false: disabled)";
            delTargetNode.Name             = OPT_DEL_TARGET;
            delTargetNode.ContextMenuStrip = ctxDeleteTarget;

            //Options - Source Class Filter
            TreeNode srcFilterNode = new TreeNode("Source Class Filter");

            srcFilterNode.ToolTipText      = "The filter to apply to the source query where the features will be copied from";
            srcFilterNode.Name             = OPT_CLS_FILTER;
            srcFilterNode.ContextMenuStrip = ctxSourceFilter;

            //Options - Flatten Geometries
            TreeNode flattenNode = new TreeNode("Flatten Geometries");

            flattenNode.ToolTipText      = "If true, will strip all Z and M coordinates from geometries being copied";
            flattenNode.Name             = OPT_FLATTEN;
            flattenNode.ContextMenuStrip = ctxFlatten;

            //Options - Force WKB
            TreeNode forceWkbNode = new TreeNode("Force WKB Geometry");

            forceWkbNode.ToolTipText      = "If true, will force the input geometry to be WKB compliant";
            forceWkbNode.Name             = OPT_FORCEWKB;
            forceWkbNode.ContextMenuStrip = ctxForceWkb;

            _node.Nodes.Add(delTargetNode);
            _node.Nodes.Add(srcFilterNode);
            _node.Nodes.Add(flattenNode);
            _node.Nodes.Add(forceWkbNode);

            //Set default values to avoid any nasty surprises
            this.Delete       = false;
            this.SourceFilter = string.Empty;
            this.Flatten      = false;
            this.ForceWkb     = false;

            //Test for batch support
            using (FdoFeatureService svc = Parent.GetTargetConnection().CreateFeatureService())
            {
                if (svc.SupportsBatchInsertion())
                {
                    TreeNode batchNode = new TreeNode("Insert Batch Size");
                    batchNode.ToolTipText      = "The batch size to use for batch insert. If set to 0, normal insert will be used";
                    batchNode.ContextMenuStrip = ctxBatchSize;
                    _node.Nodes.Add(batchNode);
                    //Set default values to avoid any nasty surprises
                    this.BatchSize = 0;
                }
            }
        }
        internal OptionsNodeDecorator(CopyTaskNodeDecorator parent, TreeNode optionsNode)
        {
            Parent = parent;
            _node = optionsNode;

            InitContextMenus();

            //Options - Delete Target
            TreeNode delTargetNode = new TreeNode("Delete Target");
            delTargetNode.ToolTipText = "Delete all features on the feature class before copying (true: enabled, false: disabled)";
            delTargetNode.Name = OPT_DEL_TARGET;
            delTargetNode.ContextMenuStrip = ctxDeleteTarget;

            //Options - Source Class Filter
            TreeNode srcFilterNode = new TreeNode("Source Class Filter");
            srcFilterNode.ToolTipText = "The filter to apply to the source query where the features will be copied from";
            srcFilterNode.Name = OPT_CLS_FILTER;
            srcFilterNode.ContextMenuStrip = ctxSourceFilter;

            //Options - Flatten Geometries
            TreeNode flattenNode = new TreeNode("Flatten Geometries");
            flattenNode.ToolTipText = "If true, will strip all Z and M coordinates from geometries being copied";
            flattenNode.Name = OPT_FLATTEN;
            flattenNode.ContextMenuStrip = ctxFlatten;

            //Options - Force WKB
            TreeNode forceWkbNode = new TreeNode("Force WKB Geometry");
            forceWkbNode.ToolTipText = "If true, will force the input geometry to be WKB compliant";
            forceWkbNode.Name = OPT_FORCEWKB;
            forceWkbNode.ContextMenuStrip = ctxForceWkb;

            _node.Nodes.Add(delTargetNode);
            _node.Nodes.Add(srcFilterNode);
            _node.Nodes.Add(flattenNode);
            _node.Nodes.Add(forceWkbNode);

            //Set default values to avoid any nasty surprises
            this.Delete = false;
            this.SourceFilter = string.Empty;
            this.Flatten = false;
            this.ForceWkb = false;

            //Test for batch support
            using (FdoFeatureService svc = Parent.GetTargetConnection().CreateFeatureService())
            {
                if (svc.SupportsBatchInsertion())
                {
                    TreeNode batchNode = new TreeNode("Insert Batch Size");
                    batchNode.ToolTipText = "The batch size to use for batch insert. If set to 0, normal insert will be used";
                    batchNode.ContextMenuStrip = ctxBatchSize;
                    _node.Nodes.Add(batchNode);
                    //Set default values to avoid any nasty surprises
                    this.BatchSize = 0;
                }
            }
        }