public void SetXenObjects(IXenObject orig, IXenObject clone) { if (clone == null) { return; } this.xenObjectCopy = clone; this.xenObjectOrig = orig; if (tagsEditor != null) { tagsEditor.Dispose(); } tagsEditor = new TagsEditor(GetTagsFromXenObjectCopy(), tagsPanel); tagsEditor.Location = new Point(5, 5); tagsEditor.Size = new Size(tagsPanel.Width - 10, tagsPanel.Height - 10); tagsEditor.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; if (folderEditor != null) { folderEditor.Dispose(); } folderEditor = new FolderEditor(clone.Path); folderEditor.Parent = folderPanel; folderEditor.Location = new Point(0, 2); folderEditor.Size = new Size(folderPanel.Width - 6, folderPanel.Height - 4); folderEditor.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; Repopulate(); }
protected override Control AddEditor(Control container) { TagsEditor t = new TagsEditor(); t.ID = Name; container.Controls.Add(t); return(t); }
// This function is called when the object is loaded private void OnEnable() { // Get the scriptable object of the project containing all tags and load them reference = MultiTagsUtility.GetTagsAsset(); // Creates editor for the reference referenceEditor = (TagsEditor)Editor.CreateEditor(reference); }
public override void UpdateEditor(ContentItem item, Control editor) { TagsEditor tagEditor = editor as TagsEditor; IList <Items.TagGroup> containers = GetAvailableCategories(item); if (containers != null) { List <AppliedTags> changes = GetChanges(item, containers); tagEditor.BindTo(changes); } }
public override bool UpdateItem(ContentItem item, Control editor) { TagsEditor tagEditor = editor as TagsEditor; if (tagEditor.HasChanges) { IList <Items.TagGroup> containers = GetAvailableCategories(item); IEnumerable <AppliedTags> changes = tagEditor.GetAddedTags(containers); foreach (AppliedTags change in changes) { ApplyChanges(change, item); } } return(tagEditor.HasChanges); }