Exemplo n.º 1
0
        public void Add(IEnumerable <string> existingNames)
        {
            _isAdd = true;
            Title  = "New Template";

            _fieldsChanged = false;

            InitPredefinedFieldValues();
            ResetFieldValuesForAllBuffers();

            _unmodifiedValue = Kernel.Get <TemplateDialogViewModel>();
            _unmodifiedValue.CopyFrom(this);

            _existingNames = existingNames;
        }
Exemplo n.º 2
0
        public void Edit(IEnumerable <string> existingNames)
        {
            _isAdd = false;
            Title  = $"Editing \"{Name}\"";

            _existingNames = existingNames.Where(t => !string.Equals(t, Name, StringComparison.OrdinalIgnoreCase)).ToList();

            _fieldsChanged = false;

            InitPredefinedFieldValues();
            ResetFieldValuesForAllBuffers();

            // Save unmodified properties.
            _unmodifiedValue = Kernel.Get <TemplateDialogViewModel>();
            _unmodifiedValue.CopyFrom(this);
        }