protected override void RefreshData() { base.RefreshData(); TextKeyView owner = (TextKeyView)Object; owner.UpdateTexts(); }
protected override void SetDirty() { TextKeyView owner = (TextKeyView)Object; if (owner._OwnerEditor != null) { owner._OwnerEditor.SetChanged(true); } }
private bool KeyExist(TextKeyView view, IEnumerable <TextKey> keys) { foreach (var k in keys) { if (view.Key == k) { return(true); } } return(false); }
void _BtnAdd_Click(object sender, System.EventArgs e) { TextKeyView view = new TextKeyView(new TextKey() { Key = "New" }, this); _ListBox.Controls.Add(view); _ListBox.SelectedItem = view; SetChanged(true); }
private void Rebuild() { _ListBox.Controls.Clear(); if (_Dictionary != null) { if (_Dictionary.Keys != null) { foreach (var key in _Dictionary.Keys) { TextKeyView view = new TextKeyView(key, this); _ListBox.Controls.Add(view); } } // search for new AudioClipSubtitles in AudioSubtitle that we didn't create AudioField for them foreach (var t in _Dictionary.Subtitles) { if (t != null) { if (!IsAudioFieldExistWithSubtitle(t)) { CreateAudioField(t); } } } // search for removed AudioClipSubtitles in AudioSubtitle that we did create AudioField for them int index = 0; while (index < _Fields.Count) { var e = _Fields[index]; if (!IsAudioClipSubtitleExistInSubtitles(e.Subtitle)) { _Fields.Remove(e); _AudioList.Controls.Remove(e); continue; } index++; } UpdateBtnNewVisibility(); } else { _AudioList.Controls.Clear(); _Fields.Clear(); _BtnNew.Visibility = Skill.Framework.UI.Visibility.Hidden; } SetChanged(false); }
private void Select(object item) { _BtnRemove.IsEnabled = item != null; if (item != null) { _SelectedView = (TextKeyView)item; } else { _SelectedView = null; } Skill.Editor.UI.InspectorProperties.Select(_SelectedView); Skill.Editor.UI.EditorFrame.RepaintParentEditorWindow(_Frame.Grid); }
private void Refresh() { if (_Dictionary == null) { this.Controls.Clear(); this._List.Clear(); } else { if (Dictionary.Keys != null) { foreach (var k in Dictionary.Keys) { if (k != null) { if (!ViewExist(k)) { TextKeyView view = new TextKeyView(k, null); this._List.Add(view); this.Controls.Add(view); } } } int index = 0; while (index < _List.Count) { var view = _List[index]; if (!KeyExist(view, Dictionary.Keys)) { this._List.Remove(view); this.Controls.Remove(view); continue; } index++; } } } }
public MyProperties(TextKeyView owner) : base(owner) { }