Exemplo n.º 1
0
        private void nameComboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            PropertyEditControl selectedItem = (PropertyEditControl)this.nameComboBox.SelectedItem;

            // is the selection a special svn: keyword?
            if (selectedItem != null)
            {
                SetNewEditor(selectedItem);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds the property editor if it allows the current SvnItem's node kind
        /// </summary>
        /// <param name="propEditor">IPropertyEditor</param>
        private void AddPropertyEditor(PropertyEditControl propEditor)
        {
            if (!propEditor.AllowNodeKind(_currentNodeKind))
            {
                return;
            }

            // TODO: Perhaps allow applying file properties recursively on a folder

            string key = propEditor.ToString();

            this.keyPropEditor.Add(key, propEditor);
        }
Exemplo n.º 3
0
        private void SetNewEditor(PropertyEditControl editor)
        {
            if (this._currentEditor != null)
            {
                //Unsubscribe the current editor from the Changed event.
                this._currentEditor.Changed -= new EventHandler(
                    this.currentEditor_Changed);
            }

            //Clear the editor panel and add the new editor.
            this.editorPanel.Controls.Clear();
            this.editorPanel.Controls.Add((Control)editor);
            ((Control)editor).Dock = DockStyle.Fill;

            //Sets the current editor to match the selected item.
            this._currentEditor = editor;
            UpdateButtons(); // allow new peoperty editor to determine the initial button states
            this._currentEditor.Changed += new EventHandler(
                this.currentEditor_Changed);
        }
Exemplo n.º 4
0
        /// <remarks>
        /// If the typed name is a built-in svn property, sets combo selection to the editor.
        /// If the typed name is a custom property, create a new <code>PlainPropertyEditor</code>
        /// </remarks>
        private void nameComboBox_TextChanged(object sender, EventArgs e)
        {
            string typedName = this.nameComboBox.Text;

            if (this.keyPropEditor.ContainsKey(typedName))
            {
                PropertyEditControl propEditor = this.keyPropEditor[typedName];
                this.nameComboBox.SelectedItem = propEditor;
            }
            else
            {
                if (this._currentEditor == null ||
                    !(this._currentEditor is PlainPropertyEditor))
                {
                    this.SetNewEditor(new PlainPropertyEditor());
                }
            }

            if (this._currentEditor != null)
            {
                this._currentEditor.PropertyName = this.nameComboBox.Text;
            }
        }
Exemplo n.º 5
0
        private void SetNewEditor(PropertyEditControl editor)
        {
            if (this._currentEditor != null)
            {
                //Unsubscribe the current editor from the Changed event.
                this._currentEditor.Changed -= new EventHandler(
                    this.currentEditor_Changed);
            }

            //Clear the editor panel and add the new editor.
            this.editorPanel.Controls.Clear();
            this.editorPanel.Controls.Add((Control)editor);
            ((Control)editor).Dock = DockStyle.Fill;

            //Sets the current editor to match the selected item.
            this._currentEditor = editor;
            UpdateButtons(); // allow new peoperty editor to determine the initial button states
            this._currentEditor.Changed += new EventHandler(
                this.currentEditor_Changed);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Adds the property editor if it allows the current SvnItem's node kind
        /// </summary>
        /// <param name="propEditor">IPropertyEditor</param>
        private void AddPropertyEditor(PropertyEditControl propEditor)
        {
            if (!propEditor.AllowNodeKind(_currentNodeKind))
                return;

            // TODO: Perhaps allow applying file properties recursively on a folder

            string key = propEditor.ToString();
            this.keyPropEditor.Add(key, propEditor);
        }