Exemplo n.º 1
0
        public async Task InitializeAsync()
        {
            var state = await treeStateStore.Get();

            if (state is null)
            {
                state = treeStateFactory.CreateTree();
                await treeStateStore.Set(state);
            }

            TreeBehaviour = new TreeBehaviourEngine(config, state);
        }
Exemplo n.º 2
0
        private static async Task MigrateSettingsAsync()
        {
            var legacyStateStore = new LocalStorageLegacyTreeStateStore(config.SettingPrefix);

            var state = legacyStateStore.Get();

            if (state != null)
            {
                // migrate to new store
                await treeStateStore.Set(state);

                legacyStateStore.RemoveLegacy();
            }
        }