An event argument object passed when a connection is renamed
Inheritance: System.EventArgs
Beispiel #1
0
 protected override void OnConnectionRenamed(object sender, ConnectionRenameEventArgs e)
 {
     int idx = GetConnectionIndex(e.OldName);
     if (idx >= 0)
     {
         grdConnections.Rows[idx].Cells[0].Value = e.NewName;
         UpdateConnectionReferences(e.OldName, e.NewName);
     }
 }
        /// <summary>
        /// Renames a connection.
        /// </summary>
        /// <param name="oldName">The old name.</param>
        /// <param name="newName">The new name.</param>
        public void RenameConnection(string oldName, string newName)
        {
            if (!_ConnectionDict.ContainsKey(oldName))
            {
                throw new FdoConnectionException("The connection to be renamed could not be found: " + oldName);
            }
            if (_ConnectionDict.ContainsKey(newName))
            {
                throw new FdoConnectionException("Cannot rename connection " + oldName + " to " + newName + " as a connection of that name already exists");
            }

            FdoConnection conn = _ConnectionDict[oldName];

            _ConnectionDict.Remove(oldName);
            _ConnectionDict.Add(newName, conn);

            ConnectionRenameEventArgs e = new ConnectionRenameEventArgs(oldName, newName);

            this.ConnectionRenamed(this, e);
        }
        /// <summary>
        /// Renames a connection.
        /// </summary>
        /// <param name="oldName">The old name.</param>
        /// <param name="newName">The new name.</param>
        public void RenameConnection(string oldName, string newName)
        {
            if (!_ConnectionDict.ContainsKey(oldName))
                throw new FdoConnectionException("The connection to be renamed could not be found: " + oldName);
            if (_ConnectionDict.ContainsKey(newName))
                throw new FdoConnectionException("Cannot rename connection " + oldName + " to " + newName + " as a connection of that name already exists");

            FdoConnection conn = _ConnectionDict[oldName];
            _ConnectionDict.Remove(oldName);
            _ConnectionDict.Add(newName, conn);

            ConnectionRenameEventArgs e = new ConnectionRenameEventArgs(oldName, newName);
            this.ConnectionRenamed(this, e);
        }
 void OnConnectionRenamed(object sender, ConnectionRenameEventArgs e)
 {
     _taskMgr.UpdateConnectionReferences(e.OldName, e.NewName);
 }
Beispiel #5
0
 protected virtual void OnConnectionRenamed(object sender, ConnectionRenameEventArgs e) { }
 void OnConnectionRenamed(object sender, ConnectionRenameEventArgs e)
 {
     TreeNode node = _explorer.GetRootNode(RootNodeName).Nodes[e.OldName];
     node.Name = node.Text = e.NewName;
 }
Beispiel #7
0
        protected override void OnConnectionRenamed(object sender, ConnectionRenameEventArgs e)
        {
            var left = (BindingList<string>)cmbLeftConnection.DataSource;
            var right = (BindingList<string>)cmbRightConnection.DataSource;
            var target = (BindingList<string>)cmbTargetConnection.DataSource;

            var idx = left.IndexOf(e.OldName);
            if (idx >= 0)
                left[idx] = e.NewName;

            idx = right.IndexOf(e.OldName);
            if (idx >= 0)
                right[idx] = e.NewName;

            idx = target.IndexOf(e.OldName);
            if (idx >= 0)
                target[idx] = e.NewName;

            /*
            string selLeft = this.SelectedLeftConnection;
            string selRight = this.SelectedRightConnection;
            string selTarget = this.SelectedTargetConnection;

            //Fix the selected values if they are affected
            if (selLeft.Equals(e.OldName))
            {
                selLeft = e.NewName;
            }
            if (selRight.Equals(e.OldName))
            {
                selRight = e.NewName;
            }
            if (selTarget.Equals(e.OldName))
            {
                selTarget = e.NewName;
            }

            //Fix the list, any list that is fixed needs to have
            //their current value re-set
            if (left.Contains(e.OldName))
            {
                left.Remove(e.OldName);
                left.Add(e.NewName);

                this.LeftConnections = left;
                this.SelectedLeftConnection = selLeft;
            }
            if (right.Contains(e.OldName))
            {
                right.Remove(e.OldName);
                right.Add(e.NewName);

                this.RightConnections = right;
                this.SelectedRightConnection = selRight;
            }
            if (target.Contains(e.OldName))
            {
                target.Remove(e.OldName);
                target.Add(e.NewName);

                this.TargetConnections = target;
                this.SelectedTargetConnection = selTarget;
            }*/
        }