Example #1
0
        /// <summary>
        /// Bring up Property Dialog in Add mode.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addButton_Click(object sender, System.EventArgs e)
        {
            using (PropertyDialog propDialog = new PropertyDialog(_currentNodeKind))
            {
                if (propDialog.ShowDialog(Context) != DialogResult.OK)
                {
                    return;
                }

                SvnPropertyValue value = propDialog.GetPropertyItem();
                if (value != null)
                {
                    PropertyEditItem pi;
                    if (!_propItems.TryGetValue(value.Key, out pi))
                    {
                        _propItems[value.Key] = pi = new PropertyEditItem(propListView, value.Key);
                    }

                    pi.Value = value;
                    pi.Refresh();

                    if (!propListView.Items.Contains(pi))
                    {
                        PopulateListView();
                    }

                    this.UpdateButtons();
                }
            }
        }
Example #2
0
        /// <summary>
        /// Brings up the Property Dialog in edit mode.
        /// </summary>
        private void editButton_Click(object sender, System.EventArgs e)
        {
            PropertyEditItem item = (PropertyEditItem)this.propListView.SelectedItems[0];

            using (PropertyDialog pDialog = new PropertyDialog(item.Value, _currentNodeKind))
            {
                if (pDialog.ShowDialog(Context) != DialogResult.OK)
                {
                    return;
                }

                SvnPropertyValue value = pDialog.GetPropertyItem();
                if (value != null)
                {
                    if (value.Key != item.PropertyName)
                    {
                        item.Value = null; // Deleted
                        item.Refresh();

                        PropertyEditItem pi;

                        if (!_propItems.TryGetValue(value.Key, out pi))
                        {
                            _propItems[value.Key] = pi = new PropertyEditItem(propListView, value.Key);
                        }

                        pi.Value = value;

                        PopulateListView(); // Add new item
                    }
                    else
                    {
                        item.Value = value;
                        item.Refresh();
                    }
                }
                else
                {
                    item.Value = null;
                    if (item.BaseValue == null)
                    {
                        _propItems.Remove(item.PropertyName);
                        propListView.Items.Remove(item);
                    }
                    else
                    {
                        item.Refresh();
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        /// Brings up the Property Dialog in edit mode.
        /// </summary>
        private void editButton_Click(object sender, System.EventArgs e)
        {
            PropertyEditItem item = (PropertyEditItem)this.propListView.SelectedItems[0];

            using (PropertyDialog pDialog = new PropertyDialog(item.Value, _currentNodeKind))
            {
                if (pDialog.ShowDialog(Context) != DialogResult.OK)
                    return;

                SvnPropertyValue value = pDialog.GetPropertyItem();
                if (value != null)
                {
                    if (value.Key != item.PropertyName)
                    {
                        item.Value = null; // Deleted
                        item.Refresh();

                        PropertyEditItem pi;

                        if (!_propItems.TryGetValue(value.Key, out pi))
                            _propItems[value.Key] = pi = new PropertyEditItem(propListView, value.Key);

                        pi.Value = value;

                        PopulateListView(); // Add new item
                    }
                    else
                    {
                        item.Value = value;
                        item.Refresh();
                    }
                }
                else
                {
                    item.Value = null;
                    if(item.BaseValue == null)
                    {
                        _propItems.Remove(item.PropertyName);
                        propListView.Items.Remove(item);
                    }
                    else
                        item.Refresh();
                }
            }
        }
Example #4
0
        /// <summary>
        /// Bring up Property Dialog in Add mode.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void addButton_Click(object sender, System.EventArgs e)
        {
            using (PropertyDialog propDialog = new PropertyDialog(_currentNodeKind))
            {
                if (propDialog.ShowDialog(Context) != DialogResult.OK)
                    return;

                SvnPropertyValue value = propDialog.GetPropertyItem();
                if (value != null)
                {
                    PropertyEditItem pi;
                    if (!_propItems.TryGetValue(value.Key, out pi))
                        _propItems[value.Key] = pi = new PropertyEditItem(propListView, value.Key);

                    pi.Value = value;
                    pi.Refresh();

                    if (!propListView.Items.Contains(pi))
                        PopulateListView();

                    this.UpdateButtons();
                }
            }
        }