public CoordSysCatalogPresenter(ICoordSysCatalogView view, FdoToolbox.Base.Services.CoordSysCatalog catalog)
 {
     _view = view;
     _catalog = catalog;
     _view.DeleteEnabled = false;
     _view.EditEnabled = false;
 }
        /// <summary>
        /// Adds a FDO connection.
        /// </summary>
        /// <param name="name">The name of the connection.</param>
        /// <param name="conn">The connection.</param>
        public void AddConnection(string name, FdoToolbox.Core.Feature.FdoConnection conn)
        {
            if (_ConnectionDict.ContainsKey(name))
                throw new FdoConnectionException("Unable to add connection named " + name + " to the connection manager");

            if (conn.State != FdoConnectionState.Open)
                conn.Open();

            _ConnectionDict.Add(name, conn);
            this.ConnectionAdded(this, new EventArgs<string>(name));
        }
예제 #3
0
 void OnMessageSent(object sender, FdoToolbox.Core.MessageEventArgs e)
 {
     if (txtOutput.InvokeRequired)
     {
         txtOutput.Invoke(new AppendTextHandler(this.AppendText), e.Message);
     }
     else
     {
         this.AppendText(e.Message);
     }
 }
예제 #4
0
        /// <summary>
        /// Prepares the specified bulk copy definition (freshly deserialized) before the loading process begins
        /// </summary>
        /// <param name="def">The bulk copy definition.</param>
        protected override NameValueCollection Prepare(FdoToolbox.Core.Configuration.FdoBulkCopyTaskDefinition def)
        {
            /* There is subtle precondition that would've resulted in all connection references being named to a
             * single reference, thus invalidating the whole task when loaded.
             * 
             * If the task definition has any connection names to an *already* loaded connection, a rename operation
             * could overwrite a previous rename operation. Consider:
             * 
             * Connection A) SDF_Desktop
             * Connection B) SDFConnection0
             * 
             * Loaded Connections:
             * - SDFConnection0
             * - SDFConnection1
             * 
             * If during loading, SDF_Desktop matches to SDFConnection0, and SDFConnection0 matches to SDFConnection1 the rename operations
             * would then be:
             * 
             * 1) Rename SDF_Desktop to SDFConnection0
             * 2) Rename SDF_Connection0 to SDFConnection1
             * 
             * As a result, all referenced connections will eventually be renamed to SDFConnection1, which is not what we want.
             * 
             * The solution bere is to "fix" the definition by renaming the named connections to something we know is not already a loaded
             * connection. This is done regardless to ensure consistent behaviour. Thsi method performs this solution.
             */

            string prefix = "Connection";
            int counter = 0;
            FdoConnectionManager connMgr = ServiceManager.Instance.GetService<FdoConnectionManager>();

            NameValueCollection nameMappings = new NameValueCollection();

            foreach (FdoConnectionEntryElement el in def.Connections)
            {
                string newName = prefix + counter;
                while (connMgr.GetConnection(newName) != null)
                {
                    counter++;
                    newName = prefix + counter;
                }
                string oldName = el.name;
                def.UpdateConnectionReferences(oldName, newName);
                nameMappings.Add(newName, oldName);
                counter++;
            }

            return nameMappings;
        }
        void OnTaskAdded(object sender, FdoToolbox.Core.EventArgs<string> e)
        {
            string name = e.Data;
            TreeNode node = new TreeNode();
            node.Name = node.Text = name;
            node.ImageKey = node.SelectedImageKey = IMG_TASK;
            node.ContextMenuStrip = _explorer.GetContextMenu(NODE_TASK);

            TreeNode root = _explorer.GetRootNode(RootNodeName);
            root.Nodes.Add(node);
            node.Expand();
            root.Expand();
        }
 void OnTaskRemoved(object sender, FdoToolbox.Core.EventArgs<string> e)
 {
     _explorer.GetRootNode(RootNodeName).Nodes.RemoveByKey(e.Data);
 }
예제 #7
0
 protected virtual void OnConnectionAdded(object sender, FdoToolbox.Core.EventArgs<string> e) { }
예제 #8
0
 public void SetRestrictions(FdoToolbox.Core.Feature.ICapability cap)
 {
     
 }
 /// <summary>
 /// Called when this process has finished processing.
 /// </summary>
 /// <param name="op">The op.</param>
 protected override void OnFinishedProcessing(FdoToolbox.Core.ETL.Operations.FdoOperationBase op)
 {
     //We want to avoid log chatter on specialized ETL processes so suppress the base call
 }
예제 #10
0
 /// <summary>
 /// Called when a row is processed.
 /// </summary>
 /// <param name="op">The operation.</param>
 /// <param name="dictionary">The dictionary.</param>
 protected override void OnFeatureProcessed(FdoToolbox.Core.ETL.Operations.FdoOperationBase op, FdoRow dictionary)
 {
     //We want to avoid log chatter on specialized ETL processes so suppress the base call   
 }
        void OnConnectionRefreshed(object sender, FdoToolbox.Core.EventArgs<string> e)
        {
            TreeNode root = _explorer.GetRootNode(RootNodeName);
            root.Nodes.RemoveByKey(e.Data);
            string name = e.Data;
            TreeNode node = new TreeNode();
            node.Name = node.Text = name;

            FdoConnection conn = _connMgr.GetConnection(name);
            ProviderDatastoreType dtype = conn.DataStoreType;
            switch (dtype)
            {
                case ProviderDatastoreType.ProviderDatastoreType_DatabaseServer:
                    node.ImageKey = node.SelectedImageKey = IMG_DB_CONNECTION;
                    break;
                case ProviderDatastoreType.ProviderDatastoreType_File:
                    node.ImageKey = node.SelectedImageKey = IMG_FILE_CONNECTION;
                    break;
                case ProviderDatastoreType.ProviderDatastoreType_Unknown:
                    node.ImageKey = node.SelectedImageKey = IMG_CONNECTION;
                    break;
                case ProviderDatastoreType.ProviderDatastoreType_WebServer:
                    node.ImageKey = node.SelectedImageKey = IMG_SERVER_CONNECTION;
                    break;
            }

            node.ContextMenuStrip = _explorer.GetContextMenu(NODE_CONNECTION);

            CreateSchemaNodes(node);
            node.Tag = true; //Schema fully loaded

            SetConnectionToolTip(node, conn);

            root.Nodes.Add(node);
            node.Expand();
            root.Expand();
        }
        void OnConnectionAdded(object sender, FdoToolbox.Core.EventArgs<string> e)
        {
            string name = e.Data;
            TreeNode node = new TreeNode();
            node.Name = node.Text = name;

            FdoConnection conn = _connMgr.GetConnection(name);
            ProviderDatastoreType dtype = conn.DataStoreType;
            switch (dtype)
            {
                case ProviderDatastoreType.ProviderDatastoreType_DatabaseServer:
                    node.ImageKey = node.SelectedImageKey = IMG_DB_CONNECTION;
                    break;
                case ProviderDatastoreType.ProviderDatastoreType_File:
                    node.ImageKey = node.SelectedImageKey = IMG_FILE_CONNECTION;
                    break;
                case ProviderDatastoreType.ProviderDatastoreType_Unknown:
                    node.ImageKey = node.SelectedImageKey = IMG_CONNECTION;
                    break;
                case ProviderDatastoreType.ProviderDatastoreType_WebServer:
                    node.ImageKey = node.SelectedImageKey = IMG_SERVER_CONNECTION;
                    break;
            }

            node.ContextMenuStrip = _explorer.GetContextMenu(NODE_CONNECTION);

            //Don't Describe the schema now, do it when node is expanded for the first time
            //use a boolean tag to indicate this state.

            node.Tag = false; //Schema not loaded
            //HACK: TreeNode requires at least one child node to display the expand icon
            //so add a dummy node. When expanded, and describe schema executes for the first time,
            //the node will be gone anyway.
            node.Nodes.Add(string.Empty);

            TreeNode root = _explorer.GetRootNode(RootNodeName);
            root.Nodes.Add(node);
            root.Expand();

            SetConnectionToolTip(node, conn);
        }
예제 #13
0
        public bool DependsOnConnection(FdoToolbox.Core.Feature.FdoConnection conn)
        {
            IFdoConnectionManager connMgr = ServiceManager.Instance.GetService<IFdoConnectionManager>();
            FdoConnection left = connMgr.GetConnection(this.SelectedLeftConnection);
            FdoConnection right = connMgr.GetConnection(this.SelectedRightConnection);
            FdoConnection target = connMgr.GetConnection(this.SelectedTargetConnection);

            return conn == left || conn == right || conn == target;
        }
예제 #14
0
        /// <summary>
        /// Adds the property.
        /// </summary>
        /// <param name="p">The p.</param>
        public void AddProperty(FdoToolbox.Core.Connections.DictionaryProperty p)
        {
            DataGridViewRow row = new DataGridViewRow();
            DataGridViewTextBoxCell nameCell = new DataGridViewTextBoxCell();
            nameCell.Value = p.LocalizedName;

            DataGridViewTextBoxCell valueCell = new DataGridViewTextBoxCell();
            if (p.IsFile || p.IsPath)
            {
                valueCell.ContextMenuStrip = ctxHelper;
                valueCell.ToolTipText = "Right click for helpful options";
            }
            valueCell.Value = p.DefaultValue;

            row.Cells.Add(nameCell);
            row.Cells.Add(valueCell);
            
            grdProperties.Rows.Add(row);

            if (p.Protected)
                pwdCells.Add(valueCell);
        }
예제 #15
0
 protected override void OnConnectionRemoved(object sender, FdoToolbox.Core.EventArgs<string> e)
 {
     string name = e.Data;
     btnAddConnection.DropDown.Items.RemoveByKey(name);
 }
예제 #16
0
 protected override void OnConnectionAdded(object sender, FdoToolbox.Core.EventArgs<string> e)
 {
     string name = e.Data;
     btnAddConnection.DropDown.Items.Add(name, null, delegate(object s, EventArgs evt)
     {
         AddParticipatingConnection(name);
     });
 }