private async Task <INavItem> ParseNavItem(JsonObject data, ControlPaletteExportProvider controlPaletteExportProvider)
        {
            string type = data.GetOptionalString("Type");

            switch (type)
            {
            case nameof(ControlPalette):
            {
                var paletteModel = new ControlPaletteModel();
                await paletteModel.InitializeData(_stringProvider, _stringProvider.GetString("ControlPaletteDataPath"));

                return(ControlPalette.ControlPaletteViewModel.Parse(_stringProvider, data, paletteModel, controlPaletteExportProvider));
            }

            case nameof(ThemePalette):
            {
                var paletteModel = new ThemePaletteModel();
                await paletteModel.InitializeData(_stringProvider, _stringProvider.GetString("ThemePaletteDataPath"));

                return(ThemePalette.ThemePaletteViewModel.Parse(_stringProvider, data, paletteModel, controlPaletteExportProvider));
            }

            default:
                throw new Exception(string.Format("Unknown nav item type {0}", type));
            }
        }
Esempio n. 2
0
        private void Run()
        {
            using (_fileWatcher = new FileWatcher(_setting.DefaultPath, _setting.Rules))
            {
                _fileWatcher.FileAdded          += OnFileAdded;
                _fileWatcher.FileMoved          += OnFileMoved;
                _fileWatcher.PatternMatchResult += OnPatternMatchResult;

                try
                {
                    _fileWatcher.StartWatch(_setting.ListeningFolders);
                }
                catch (DirectoryNotFoundException e)
                {
                    Console.WriteLine(PrepareMessage(PhrasesEnum.NOT_FOUND_FOLDER, e.Message));
                    return;
                }

                Console.WriteLine(_stringProvider.GetString(PhrasesEnum.HELLO));
                while (Console.Read() != 'q')
                {
                    ;
                }
            }
        }
        /// <summary>
        /// Get string based upon the provided culture or Current UI Culture
        /// </summary>
        /// <param name="name">The name of the key</param>
        /// <param name="culture">The culture to get the localization for</param>
        /// <returns>A localized string</returns>
        protected string GetStringSafely(string name, CultureInfo culture)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            var keyCulture = culture ?? CultureInfo.CurrentUICulture;

            _logger.SearchedLocation(name, _baseName, keyCulture);

            return(_stringProvider.GetString(name, keyCulture));
        }
Esempio n. 4
0
        protected async Task <int> HandleCommand(string configFile, bool verbose)
        {
            Logger.Verbose = verbose;
            Config.Config config;
            if (!TryLoadConfig(configFile, out config))
            {
                return(-1);
            }
            Logger.InfoWithProgress(StringProvider.GetString(Strings.LoginProgress));
            var didLogin = await Client.Login(config.Credentials.ClientId, config.Credentials.Key, config.Credentials.TenantId);

            Logger.StopProgress();
            if (didLogin)
            {
                Logger.Debug(StringProvider.GetString(Strings.LoginSuccess));
                return(await CommandLogic());
            }
            Logger.Error(StringProvider.GetString(Strings.LoginError));
            return(-1);
        }
Esempio n. 5
0
        public void HandleDeviceContextRequested(Devices.Device device, UIElement targetElement, Point point)
        {
            _deviceProvider.SelectDevices(new Devices.Device[] { device });

            MenuFlyout flyout = new MenuFlyout();

            MenuFlyoutItem renameItem = new MenuFlyoutItem();

            renameItem.Text   = _stringProvider.GetString("DeviceContextMenuItemRename");
            renameItem.Tag    = new Tuple <Devices.Device, UIElement>(device, targetElement);
            renameItem.Icon   = new SymbolIcon(Symbol.Rename);
            renameItem.Click += RenameItem_Click;
            flyout.Items.Add(renameItem);

            MenuFlyoutItem deleteItem = new MenuFlyoutItem();

            deleteItem.Text   = _stringProvider.GetString("DeviceContextMenuItemRemove");
            deleteItem.Tag    = new Tuple <Devices.Device, UIElement>(device, targetElement);
            deleteItem.Icon   = new SymbolIcon(Symbol.Remove);
            deleteItem.Click += DeleteItem_Click;
            flyout.Items.Add(deleteItem);

            MenuFlyoutSubItem moveItem = new MenuFlyoutSubItem();

            moveItem.Text = _stringProvider.GetString("DeviceContextMenuItemMove");
            moveItem.Icon = new SymbolIcon(Symbol.MoveToFolder);
            flyout.Items.Add(moveItem);

            foreach (var room in _deviceProvider.Rooms)
            {
                if (room.Id != device.Room.Id)
                {
                    MenuFlyoutItem roomItem = new MenuFlyoutItem();
                    roomItem.Text   = room.Caption;
                    roomItem.Tag    = new Tuple <Devices.Device, Devices.Room>(device, room);
                    roomItem.Click += OnMoveDeviceToRoom;
                    moveItem.Items.Add(roomItem);
                }
            }

            flyout.ShowAt(targetElement, point);
        }
Esempio n. 6
0
        public async Task <bool> Login(string clientId, string key, string tenantId)
        {
            Logger.Debug("Preparing login");
            var parameters = new Dictionary <string, object>
            {
                { "grant_type", "client_credentials" },
                { "client_id", WebUtility.UrlEncode(clientId) },
                { "client_secret", WebUtility.UrlEncode(key) },
                { "resource", "https://manage.devcenter.microsoft.com" }
            };
            var response = await RestRequest(GetQueryRequestParameters(parameters, true), string.Format(_authenticationResource, tenantId), _authenticationBase, Method.Post);

            //force new HttpClient creation afterwards
            HttpClient = null;
            if (!response.Item2.Equals(HttpStatusCode.OK))
            {
                Logger.Debug(string.Format(_stringProvider.GetString(Strings.DebugLoginError), response.Item2));
                return(false);
            }
            AccessToken = response.Item1["access_token"].ToString();
            return(true);
        }
Esempio n. 7
0
        private async Task SaveData()
        {
            StorageFile file = await FilePickerAdapters.ShowSaveFilePicker("ColorData", ".json", new Tuple <string, IList <string> >[] { new Tuple <string, IList <string> >("JSON", new List <string>()
                {
                    ".json"
                }) }, null, Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary, true, true);

            if (file == null)
            {
                return;
            }
            CachedFileManager.DeferUpdates(file);

            Preset savePreset = new Preset(file.Path, file.DisplayName, _paletteModel);
            var    saveData   = Preset.Serialize(savePreset);
            var    saveString = saveData.Stringify();

            await FileIO.WriteTextAsync(file, saveString);

            FileUpdateStatus status = await CachedFileManager.CompleteUpdatesAsync(file);

            if (status == FileUpdateStatus.Complete)
            {
                _paletteModel.AddOrReplacePreset(savePreset);
                _paletteModel.ApplyPreset(savePreset);
            }
            else
            {
                if (file == null || file.Path == null)
                {
                    return;
                }
                var           message          = string.Format(_stringProvider.GetString("ControlPaletteSaveError"), file.Path);
                ContentDialog saveFailedDialog = new ContentDialog()
                {
                    CloseButtonText = _stringProvider.GetString("ControlPaletteErrorOkButtonCaption"),
                    Title           = _stringProvider.GetString("ControlPaletteSaveErrorTitle"),
                    Content         = message
                };
                _ = saveFailedDialog.ShowAsync();
                return;
            }
        }
Esempio n. 8
0
        public async Task InitializeData(IStringProvider stringProvider, string dataPath)
        {
            _stringProvider = stringProvider;

            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(dataPath));

            string dataString = await FileIO.ReadTextAsync(file);

            JsonObject rootObject = JsonObject.Parse(dataString);

            _whiteColor = new ColorPaletteEntry(Colors.White, _stringProvider.GetString("DarkThemeTextContrastTitle"), null, FluentEditorShared.Utils.ColorStringFormat.PoundRGB, null);
            _blackColor = new ColorPaletteEntry(Colors.Black, _stringProvider.GetString("LightThemeTextContrastTitle"), null, FluentEditorShared.Utils.ColorStringFormat.PoundRGB, null);

            var lightRegionNode = rootObject[nameof(LightRegion)].GetObject();

            _lightRegion = ThemeColorPalette.Parse(lightRegionNode, null);

            var darkRegionNode = rootObject[nameof(DarkRegion)].GetObject();

            _darkRegion = ThemeColorPalette.Parse(darkRegionNode, null);

            var lightBaseNode = rootObject[nameof(LightBase)].GetObject();

            _lightBase = ThemeColorPalette.Parse(lightBaseNode, null);

            var darkBaseNode = rootObject[nameof(DarkBase)].GetObject();

            _darkBase = ThemeColorPalette.Parse(darkBaseNode, null);

            var lightPrimaryNode = rootObject[nameof(LightPrimary)].GetObject();

            _lightPrimary = ThemeColorPalette.Parse(lightPrimaryNode, null);

            var darkPrimaryNode = rootObject[nameof(DarkPrimary)].GetObject();

            _darkPrimary = ThemeColorPalette.Parse(darkPrimaryNode, null);

            var lightHyperlinkNode = rootObject[nameof(LightHyperlink)].GetObject();

            _lightHyperlink = ThemeColorPalette.Parse(lightHyperlinkNode, null);

            var darkHyperlinkNode = rootObject[nameof(DarkHyperlink)].GetObject();

            _darkHyperlink = ThemeColorPalette.Parse(darkHyperlinkNode, null);

            _presets = new ObservableList <ThemePreset>();
            if (rootObject.ContainsKey("Presets"))
            {
                var presetsNode = rootObject["Presets"].GetArray();
                foreach (var presetNode in presetsNode)
                {
                    _presets.Add(ThemePreset.Parse(presetNode.GetObject()));
                }
            }
            if (_presets.Count >= 1)
            {
                ApplyPreset(_presets[0]);
            }

            UpdateActivePreset();

            _lightColorMappings = ThemeColorMapping.ParseList(rootObject["LightPaletteMapping"].GetArray(), _lightRegion, _darkRegion, _lightBase, _darkBase, _lightPrimary, _darkPrimary, _lightHyperlink, _darkHyperlink, _whiteColor, _blackColor);
            _lightColorMappings.Sort((a, b) =>
            {
                return(a.Target.ToString().CompareTo(b.Target.ToString()));
            });

            _darkColorMappings = ThemeColorMapping.ParseList(rootObject["DarkPaletteMapping"].GetArray(), _lightRegion, _darkRegion, _lightBase, _darkBase, _lightPrimary, _darkPrimary, _lightHyperlink, _darkHyperlink, _whiteColor, _blackColor);
            _darkColorMappings.Sort((a, b) =>
            {
                return(a.Target.ToString().CompareTo(b.Target.ToString()));
            });

            void InitColorPalette(ColorPalette colorPalette,
                                  List <ThemeColorMapping> mappings,
                                  IReadOnlyList <ContrastColorWrapper> contrastColors,
                                  IReadOnlyList <IReadOnlyList <ContrastColorWrapper> > editContrastColors = null
                                  )
            {
                colorPalette.ContrastColors = contrastColors;

                if (editContrastColors != null)
                {
                    var idx = 0;
                    foreach (var entry in colorPalette.Palette)
                    {
                        if (idx < editContrastColors.Count && editContrastColors[idx] != null)
                        {
                            entry.ContrastColors = editContrastColors[idx];
                        }
                        ++idx;
                    }
                }

                colorPalette.BaseColor.ActiveColorChanged += PaletteEntry_ActiveColorChanged;

                foreach (var entry in colorPalette.Palette)
                {
                    entry.ActiveColorChanged += PaletteEntry_ActiveColorChanged;
                }

                foreach (var entry in colorPalette.Palette)
                {
                    if (entry.Description == null)
                    {
                        entry.Description = GenerateMappingDescription(entry, mappings);
                    }
                }
            }

            InitColorPalette(_lightRegion,
                             _lightColorMappings,
                             new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightBase.BaseColor, true, false), new ContrastColorWrapper(_lightPrimary.BaseColor, true, false), new ContrastColorWrapper(_lightHyperlink.BaseColor, true, false)
            },
                             new List <IReadOnlyList <ContrastColorWrapper> >()
            {
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, true, false), new ContrastColorWrapper(_blackColor, true, false),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.BaseColor, true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, false, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.BaseColor, true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, false, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.BaseColor, true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, false, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.BaseColor, true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, false, _lightRegion.BaseColor),
                },
            });

            InitColorPalette(_darkRegion,
                             _darkColorMappings,
                             new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkBase.BaseColor, true, false), new ContrastColorWrapper(_darkPrimary.BaseColor, true, false), new ContrastColorWrapper(_darkHyperlink.BaseColor, true, false)
            },
                             new List <IReadOnlyList <ContrastColorWrapper> >()
            {
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, true, false), new ContrastColorWrapper(_blackColor, true, false),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.BaseColor, true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, false, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.BaseColor, true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, false, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.BaseColor, true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, false, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.BaseColor, true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, false, _darkRegion.BaseColor),
                },
            });

            InitColorPalette(_lightBase,
                             _lightColorMappings,
                             new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.BaseColor, true, false),
            },
                             new List <IReadOnlyList <ContrastColorWrapper> >()
            {
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightPrimary.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightPrimary.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightPrimary.Palette[6], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, false, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, false, _lightRegion.BaseColor),
                },
            });

            InitColorPalette(_darkBase,
                             _darkColorMappings,
                             new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.BaseColor, true, false),
            },
                             new List <IReadOnlyList <ContrastColorWrapper> >()
            {
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkPrimary.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkPrimary.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkPrimary.Palette[6], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, false, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, false, _darkRegion.BaseColor),
                },
            });

            InitColorPalette(_lightPrimary,
                             _lightColorMappings,
                             new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.BaseColor, true, false),
            },
                             new List <IReadOnlyList <ContrastColorWrapper> >()
            {
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
            });

            InitColorPalette(_darkPrimary,
                             _darkColorMappings,
                             new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.BaseColor, true, false),
            },
                             new List <IReadOnlyList <ContrastColorWrapper> >()
            {
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
            });

            InitColorPalette(_lightHyperlink,
                             _lightColorMappings,
                             new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.BaseColor, true, false),
            },
                             new List <IReadOnlyList <ContrastColorWrapper> >()
            {
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion.Palette[0], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[1], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[2], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[3], true, true, _lightRegion.BaseColor), new ContrastColorWrapper(_lightRegion.Palette[4], true, true, _lightRegion.BaseColor),
                },
            });

            InitColorPalette(_darkHyperlink,
                             _darkColorMappings,
                             new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.BaseColor, true, false),
            },
                             new List <IReadOnlyList <ContrastColorWrapper> >()
            {
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
                new List <ContrastColorWrapper>()
                {
                    new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion.Palette[0], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[1], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[2], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[3], true, true, _darkRegion.BaseColor), new ContrastColorWrapper(_darkRegion.Palette[4], true, true, _darkRegion.BaseColor),
                },
            });
        }
Esempio n. 9
0
        public Page3ViewModel(IPageService pageService, IStringProvider stringProvider, IUUIDService uuidService, INavigation navigation)
        {
            _pageService    = pageService;
            _stringProvider = stringProvider;
            _uuidService    = uuidService;
            _navigation     = navigation;

            CommandStringProvider = new Command(async() => await _pageService.DisplayAlert(_stringProvider.GetString(), _stringProvider.GetString(), stringProvider.GetString()));
            CommandUUIDService    = new Command(async() => await _pageService.DisplayAlert(_uuidService.GetUUID(), _uuidService.GetUUID(), _uuidService.GetUUID()));
            CommandNavigateBack   = new Command(async() => await _navigation.PopAsync());
        }
Esempio n. 10
0
 public override string ToString()
 {
     return(_stringProvider?.GetString("MainPageNavMenuItem"));
 }
Esempio n. 11
0
        public async Task InitializeData(IStringProvider stringProvider, string dataPath)
        {
            _stringProvider = stringProvider;

            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(dataPath));

            string dataString = await FileIO.ReadTextAsync(file);

            JsonObject rootObject = JsonObject.Parse(dataString);

            _whiteColor = new ColorPaletteEntry(Colors.White, _stringProvider.GetString("DarkThemeTextContrastTitle"), null, FluentEditorShared.Utils.ColorStringFormat.PoundRGB, null);
            _blackColor = new ColorPaletteEntry(Colors.Black, _stringProvider.GetString("LightThemeTextContrastTitle"), null, FluentEditorShared.Utils.ColorStringFormat.PoundRGB, null);

            var lightRegionNode = rootObject["LightRegion"].GetObject();

            _lightRegion = ColorPaletteEntry.Parse(lightRegionNode, null);

            var darkRegionNode = rootObject["DarkRegion"].GetObject();

            _darkRegion = ColorPaletteEntry.Parse(darkRegionNode, null);

            var lightBaseNode = rootObject["LightBase"].GetObject();

            _lightBase = ColorPalette.Parse(lightBaseNode, null);

            var darkBaseNode = rootObject["DarkBase"].GetObject();

            _darkBase = ColorPalette.Parse(darkBaseNode, null);

            var lightPrimaryNode = rootObject["LightPrimary"].GetObject();

            _lightPrimary = ColorPalette.Parse(lightPrimaryNode, null);

            var darkPrimaryNode = rootObject["DarkPrimary"].GetObject();

            _darkPrimary = ColorPalette.Parse(darkPrimaryNode, null);

            _presets = new ObservableList <Preset>();
            if (rootObject.ContainsKey("Presets"))
            {
                var presetsNode = rootObject["Presets"].GetArray();
                foreach (var presetNode in presetsNode)
                {
                    _presets.Add(Preset.Parse(presetNode.GetObject()));
                }
            }
            if (_presets.Count >= 1)
            {
                ApplyPreset(_presets[0]);
            }

            UpdateActivePreset();

            _lightRegion.ContrastColors = new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, true, true), new ContrastColorWrapper(_lightBase.BaseColor, true, false), new ContrastColorWrapper(_lightPrimary.BaseColor, true, false)
            };
            _darkRegion.ContrastColors = new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, true, true), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkBase.BaseColor, true, false), new ContrastColorWrapper(_darkPrimary.BaseColor, true, false)
            };
            _lightBase.ContrastColors = new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, false, false), new ContrastColorWrapper(_blackColor, true, true), new ContrastColorWrapper(_lightRegion, true, false), new ContrastColorWrapper(_lightPrimary.BaseColor, true, false)
            };
            _darkBase.ContrastColors = new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, true, true), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion, true, false), new ContrastColorWrapper(_darkPrimary.BaseColor, true, false)
            };
            _lightPrimary.ContrastColors = new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, true, true), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_lightRegion, true, false), new ContrastColorWrapper(_lightBase.BaseColor, true, false)
            };
            _darkPrimary.ContrastColors = new List <ContrastColorWrapper>()
            {
                new ContrastColorWrapper(_whiteColor, true, true), new ContrastColorWrapper(_blackColor, false, false), new ContrastColorWrapper(_darkRegion, true, false), new ContrastColorWrapper(_darkBase.BaseColor, true, false)
            };

            _lightColorMappings = ColorMapping.ParseList(rootObject["LightPaletteMapping"].GetArray(), _lightRegion, _darkRegion, _lightBase, _darkBase, _lightPrimary, _darkPrimary, _whiteColor, _blackColor);
            _lightColorMappings.Sort((a, b) =>
            {
                return(a.Target.ToString().CompareTo(b.Target.ToString()));
            });

            _darkColorMappings = ColorMapping.ParseList(rootObject["DarkPaletteMapping"].GetArray(), _lightRegion, _darkRegion, _lightBase, _darkBase, _lightPrimary, _darkPrimary, _whiteColor, _blackColor);
            _darkColorMappings.Sort((a, b) =>
            {
                return(a.Target.ToString().CompareTo(b.Target.ToString()));
            });

            _lightRegion.ActiveColorChanged            += PaletteEntry_ActiveColorChanged;
            _darkRegion.ActiveColorChanged             += PaletteEntry_ActiveColorChanged;
            _lightBase.BaseColor.ActiveColorChanged    += PaletteEntry_ActiveColorChanged;
            _darkBase.BaseColor.ActiveColorChanged     += PaletteEntry_ActiveColorChanged;
            _lightPrimary.BaseColor.ActiveColorChanged += PaletteEntry_ActiveColorChanged;
            _darkPrimary.BaseColor.ActiveColorChanged  += PaletteEntry_ActiveColorChanged;
            foreach (var entry in _lightBase.Palette)
            {
                entry.ActiveColorChanged += PaletteEntry_ActiveColorChanged;
            }
            foreach (var entry in _darkBase.Palette)
            {
                entry.ActiveColorChanged += PaletteEntry_ActiveColorChanged;
            }
            foreach (var entry in _lightPrimary.Palette)
            {
                entry.ActiveColorChanged += PaletteEntry_ActiveColorChanged;
            }
            foreach (var entry in _darkPrimary.Palette)
            {
                entry.ActiveColorChanged += PaletteEntry_ActiveColorChanged;
            }

            if (_lightRegion.Description == null)
            {
                _lightRegion.Description = GenerateMappingDescription(_lightRegion, _lightColorMappings);
            }
            if (_darkRegion.Description == null)
            {
                _darkRegion.Description = GenerateMappingDescription(_darkRegion, _darkColorMappings);
            }
            foreach (var entry in _lightBase.Palette)
            {
                if (entry.Description == null)
                {
                    entry.Description = GenerateMappingDescription(entry, _lightColorMappings);
                }
            }
            foreach (var entry in _darkBase.Palette)
            {
                if (entry.Description == null)
                {
                    entry.Description = GenerateMappingDescription(entry, _darkColorMappings);
                }
            }
            foreach (var entry in _lightPrimary.Palette)
            {
                if (entry.Description == null)
                {
                    entry.Description = GenerateMappingDescription(entry, _lightColorMappings);
                }
            }
            foreach (var entry in _darkPrimary.Palette)
            {
                if (entry.Description == null)
                {
                    entry.Description = GenerateMappingDescription(entry, _darkColorMappings);
                }
            }
        }
Esempio n. 12
0
 /// <inheritdoc />
 public override ParseResult <string> Parse(string?source)
 {
     return(source == null ? ParseResult <string> .Empty : ParseResult.Success(_stringProvider.GetString(source)));
 }