Example #1
0
        protected override void OnAfterLabelEdit(LabelEditEventArgs e)
        {
            base.OnAfterLabelEdit(e);

            ResourceItem item = (ResourceItem)this.Items[e.Item];

            bool hasChanged = true;

            if ((e.Label != null) && (this.ContainsName(e.Label)))
            {
                MessageBox.Show(this, "Resource \'" + e.Label + "\' already exists.", StringTable.GetString("ApplicationName"));
                item.BeginEdit();
                hasChanged = false;
            }

            if ((e.Label == null) && (this.ContainsName(item)))
            {
                MessageBox.Show(this, "Resource \'" + item.ResourceName + "\' already exists.", StringTable.GetString("ApplicationName"));
                item.BeginEdit();
                hasChanged = false;
            }

            if (hasChanged)
            {
                this.IsDirty = true;
            }
        }
Example #2
0
        public void InsertText()
        {
            ResourceItem item = this.AddResource("[name]", "[value]");

            this.SelectedItems.Clear();
            item.Selected = true;
            item.BeginEdit();
        }