コード例 #1
0
 public bool AddManifestationType(ManifestationType newType)
 {
     if (FindLabel(newType.Id) != null)
     {
         return(false);
     }
     ManifestationTypes.Add(newType);
     SaveData();
     return(true);
 }
コード例 #2
0
        public bool DeleteManifestationType(string id)
        {
            ManifestationType target = FindManifestationType(id);

            if (target == null)
            {
                return(false);
            }
            ManifestationTypes.Remove(target);
            SaveData();
            return(true);
        }
コード例 #3
0
        public bool UpdateManifestationType(ManifestationType newTypeData)
        {
            ManifestationType target = FindManifestationType(newTypeData.Id);

            if (target == null)
            {
                return(false);
            }
            target.Name        = newTypeData.Name;
            target.IconPath    = newTypeData.IconPath;
            target.Description = newTypeData.Description;
            SaveData();
            return(true);
        }
コード例 #4
0
        public void showManifestationTypeEditView(string typeId)
        {
            model.ManifestationType target = model.Repository.GetInstance().FindManifestationType(typeId);
            if (target == null)
            {
                return;
            }
            AddManifTypeView view = new AddManifTypeView(this, true);

            view.DataContext                    = target;
            view.idInput.Text                   = target.Id;
            view.idInput.IsEnabled              = false;
            view.nameInput.Text                 = target.Name;
            view.descriptionInput.Text          = target.Description;
            view.textBoxIconPath.Text           = target.IconPath;
            view.autoGenerateId.Visibility      = Visibility.Collapsed;
            view.autoGenerateIdLabel.Visibility = Visibility.Collapsed;
            view.AddOrEditBtn.Content           = "Confirm changes";
            MainContent.Content                 = view;
        }