Exemple #1
0
            protected override void RefreshData()
            {
                base.RefreshData();
                TextKeyView owner = (TextKeyView)Object;

                owner.UpdateTexts();
            }
Exemple #2
0
            protected override void SetDirty()
            {
                TextKeyView owner = (TextKeyView)Object;

                if (owner._OwnerEditor != null)
                {
                    owner._OwnerEditor.SetChanged(true);
                }
            }
Exemple #3
0
 private bool KeyExist(TextKeyView view, IEnumerable <TextKey> keys)
 {
     foreach (var k in keys)
     {
         if (view.Key == k)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        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++;
                    }
                }
            }
        }
Exemple #8
0
 public MyProperties(TextKeyView owner)
     : base(owner)
 {
 }