Exemplo n.º 1
0
        /// <summary>
        ///     Set the value of the specified property in storage.
        /// </summary>
        /// <param name="propertyName">Name of the property to set.</param>
        /// <param name="propertyValue">Value to set the property to.</param>
        public void Persist(string propertyName, string propertyValue)
        {
            // If the value is null, make it empty.
            if (propertyValue == null)
            {
                propertyValue = string.Empty;
            }

            foreach (var config in _configs)
            {
                config[propertyName] = propertyValue;
            }

            StoreChanged?.Invoke();
        }
Exemplo n.º 2
0
        public static Task RefreshStore(AppConfigModel appConfigModel)
        {
            Store = new ApplicationStore()
            {
                Projects       = appConfigModel.Projects.ToStore(),
                DefaultProject = appConfigModel.DefaultProject,
                Guids          = appConfigModel.Guids.ToStore()
            };

            if (StoreChanged != null && StoreChanged.Target != null)
            {
                StoreChanged.Invoke();
            }


            return(Task.CompletedTask);
        }
Exemplo n.º 3
0
 public async Task LeaveEditorAsync()
 {
     EditedStore = null;
     await StoreChanged?.Invoke();
 }