Exemplo n.º 1
0
        /// <summary>
        /// Executes the add key command.
        /// </summary>
        private void ExecuteAddKeyCommand()
        {
            var newObject = new Key();
            var viewModel = new KeyEditViewModel(newObject, (RHSStringTableTools.Model.Container) this.SelectedNode);

            var view = new KeyEditView {
                DataContext = viewModel
            };

            view.ShowDialog();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Executes the duplicate key command.
        /// </summary>
        private void ExecuteDuplicateKeyCommand()
        {
            var original = this.SelectedNode as Key;

            if (original != null)
            {
                var parentContainer = original.Parent;

                var newKey = original.Clone();

                newKey.Id = string.Format("{0}_COPY", original.Id);
                var viewModel = new KeyEditViewModel(newKey, parentContainer, parentContainer.Keys.IndexOf(original));

                var view = new KeyEditView {
                    DataContext = viewModel
                };

                view.ShowDialog();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Adds the property to the stringtable
        /// </summary>
        private void AddCommandExecute()
        {
            this.ConsoleWriteLine(string.Format("Adding {0} to the stringtable.", this.SelectedProperty.Key.Value));

            var newObject = new Key
            {
                Id = string.Format("STR_{0}_{1}", this.AllProperties[this.SelectedProperty.Key].Name.ToUpper(),
                                   this.SelectedProperty.Key.Name.ToUpper()),
                AutoFillFromOriginal = true,
                Original             = this.SelectedProperty.Key.Value.Trim('"'),
                English = this.SelectedProperty.Key.Value.Trim('"')
            };

            //newObject.FillEmptyKeysWithEnglishOrOriginal();

            var viewModel = new KeyEditViewModel(newObject, (Container)this.ParentViewModel.SelectedNode);

            var view = new KeyEditView {
                DataContext = viewModel
            };

            view.ShowDialog();
        }
        /// <summary>
        /// Executes the add key command.
        /// </summary>
        private void ExecuteAddKeyCommand()
        {
            var newObject = new Key();
            var viewModel = new KeyEditViewModel(newObject, (RHSStringTableTools.Model.Container)this.SelectedNode);

            var view = new KeyEditView { DataContext = viewModel };

            view.ShowDialog();
        }
        /// <summary>
        /// Executes the duplicate key command.
        /// </summary>
        private void ExecuteDuplicateKeyCommand()
        {
            var original = this.SelectedNode as Key;

            if (original != null)
            {
                var parentContainer = original.Parent;

                var newKey = original.Clone();

                newKey.Id = string.Format("{0}_COPY", original.Id);
                var viewModel = new KeyEditViewModel(newKey, parentContainer, parentContainer.Keys.IndexOf(original));

                var view = new KeyEditView { DataContext = viewModel };

                view.ShowDialog();
            }
        }
        /// <summary>
        /// Adds the property to the stringtable
        /// </summary>
        private void AddCommandExecute()
        {
            this.ConsoleWriteLine(string.Format("Adding {0} to the stringtable.", this.SelectedProperty.Key.Value));

            var newObject = new Key
            {
                Id = string.Format("STR_{0}_{1}", this.AllProperties[this.SelectedProperty.Key].Name.ToUpper(),
                        this.SelectedProperty.Key.Name.ToUpper()),
                AutoFillFromOriginal = true,
                Original = this.SelectedProperty.Key.Value.Trim('"'),
                English = this.SelectedProperty.Key.Value.Trim('"')
            };

            //newObject.FillEmptyKeysWithEnglishOrOriginal();

            var viewModel = new KeyEditViewModel(newObject, (Container)this.ParentViewModel.SelectedNode);

            var view = new KeyEditView { DataContext = viewModel };

            view.ShowDialog();
        }