public TipViewModel(RestService reset, SoundService sound, ConfigService config, StatisticService statistic, MainService main, App app, KeyboardShortcutsService keyboardShortcuts, PreAlertService preAlert, ThemeService theme) { this.reset = reset; this.reset.TimeChanged += new RestEventHandler(timeChanged); this.reset.RestCompleted += new RestEventHandler(resetCompleted); this.sound = sound; this.config = config; this.config.Changed += config_Changed; resetCommand = new Command(new Action <object>(resetCommand_action)); busyCommand = new Command(new Action <object>(busyCommand_action)); this.statistic = statistic; this.main = main; this.keyboardShortcuts = keyboardShortcuts; this.preAlert = preAlert; this.theme = theme; theme.OnChangedTheme += Theme_OnChangedTheme; ChangedEvent += TipViewModel_ChangedEvent; LoadConfig(); }
public void ApplyThemeToScript_SingleBlockDifferentComponentName_DoesNotReplaceColour() { // Arrange var testInputBlockItem = new TextColorBlockItem(); var testInputBlock = new ItemFilterBlock(); testInputBlock.BlockItems.Add(testInputBlockItem); var testInputScript = new ItemFilterScript(); testInputScript.ItemFilterBlocks.Add(testInputBlock); var testInputTheme = new Theme(); var testInputThemeComponentColor = new Color { R = 255, G = 0, B = 1 }; var testInputThemeComponent = new ThemeComponent(ThemeComponentType.TextColor, "Test Component 1", testInputThemeComponentColor); var testInputBlockItemThemeComponent = new ThemeComponent(ThemeComponentType.TextColor, "Different Component", testInputThemeComponentColor); testInputTheme.Components.Add(testInputThemeComponent); testInputBlockItem.ThemeComponent = testInputBlockItemThemeComponent; var mockMessageBoxService = new Mock <IMessageBoxService>(); var service = new ThemeService(mockMessageBoxService.Object); // Act service.ApplyThemeToScript(testInputTheme, testInputScript); // Assert Assert.AreNotEqual(testInputThemeComponentColor, testInputBlockItem.Color); }
public OptionsViewModel(ConfigService config, MainService mainService, SystemResourcesService systemResources, SoundService sound, ThemeService theme) { this.config = config; this.mainService = mainService; this.systemResources = systemResources; this.sound = sound; this.theme = theme; Model = new OptionsModel(); Model.Data = config.options; Model.Themes = systemResources.Themes; Model.PreAlertActions = systemResources.PreAlertActions; string[] version = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.'); Model.Version = version[0] + "." + version[1] + "." + version[2]; applyCommand = new Command(new Action <object>(applyCommand_action)); openurlCommand = new Command(new Action <object>(openurlCommand_action)); inkCommand = new Command(new Action <object>(inkCommand_action)); soundTestCommand = new Command(new Action <object>(soundTestCommand_actionAsync)); updateCommand = new Command(new Action <object>(updateCommand_action)); showWindowCommand = new Command(new Action <object>(showWindowCommand_action)); addBreackProcessCommand = new Command(new Action <object>(addBreackProcessCommand_action)); removeBreackProcessCommand = new Command(new Action <object>(removeBreackProcessCommand_action)); }
public void Should_not_set_selected_theme() { var storageProvider = new Mock <IStorageProvider>(); var preferencesService = new Mock <IPreferencesService>(); SetupMockCase(preferencesService, storageProvider); var service = new ThemeService(storageProvider.Object, preferencesService.Object, new Mock <IMapper>().Object); var themes = new List <ITheme> { new Theme() { IsSelected = true, Type = "MaterialDeepPurple" }, new Theme() { IsSelected = false, Type = "Light" } }; var result = service.SetSelected(themes, new Theme() { IsSelected = true, Type = "MaterialDeepPurple" }); result.Should().Be(false); }
public async Task InitializeAsync() { var themeService = new ThemeService(Utils.MyShopifyUrl, Utils.AccessToken); var themes = await themeService.ListAsync(); ThemeId = themes.First().Id.Value; }
protected override async Task OnInitializedAsync() { try { _themeName = WebUtility.UrlDecode(PageState.QueryString["name"]); var themes = await ThemeService.GetThemesAsync(); var theme = themes.FirstOrDefault(item => item.ThemeName == _themeName); if (theme != null) { _name = theme.Name; _version = theme.Version; _owner = theme.Owner; _url = theme.Url; _contact = theme.Contact; _license = theme.License; } } catch (Exception ex) { await logger.LogError(ex, "Error Loading Theme {ThemeName} {Error}", _themeName, ex.Message); AddModuleMessage("Error Loading Theme", MessageType.Error); } }
/// <summary> /// 获取用户当前选中的皮肤 /// </summary> /// <param name="ownerId">拥有者Id(如:用户Id、群组Id)</param> /// <returns></returns> public string GetThemeAppearance(long ownerId) { var groupService = new GroupService(); GroupEntity group = groupService.Get(ownerId); if (group == null) { return(string.Empty); } PresentArea pa = new PresentAreaService().Get(PresentAreaKeysOfBuiltIn.GroupSpace); if (pa != null && !pa.EnableThemes) { return(pa.DefaultThemeKey + "," + pa.DefaultAppearanceKey); } if (group.IsUseCustomStyle) { return("Default,Default"); } else if (!string.IsNullOrEmpty(group.ThemeAppearance)) { var appearance = new ThemeService().GetThemeAppearance(PresentAreaKeysOfBuiltIn.GroupSpace, group.ThemeAppearance); if (appearance != null) { return(group.ThemeAppearance); } } if (pa != null) { return(pa.DefaultThemeKey + "," + pa.DefaultAppearanceKey); } return(string.Empty); }
public static ThemeController Create(Context context) { var themeRepository = new ThemeRepository(context); var themeService = new ThemeService(themeRepository); var themeController = new ThemeController(themeService); return(themeController); }
private void Billing_Load(object sender, EventArgs e) { BindComUser(); BindProduct(); a = 0; ThemeService.ActiveTheme(this); dataListProducts.BackgroundColor = this.BackColor; }
public PaginationHelper(ThemeService themeService, IServiceProvider services) : base("pagination", HelperType.HandlebarsHelper) { _themeService = themeService; _viewEngine = new Lazy <IHandlebarsViewEngine>(services.GetService <IHandlebarsViewEngine>); _themeService.ThemeChanged += async(_, __) => await SetTemplateAsync(); SetTemplateAsync(); }
public int?DonnerParNom(ChercherPar cp) { ThemeService rs = new ThemeService(); return(rs.DonnerParNom(cp.chercheString)); throw new NotImplementedException(); }
private void About_Load(object sender, EventArgs e) { ThemeService.ActiveTheme(this); lblPassword.BackColor = pnlReset.BackColor; txtPassword.BackColor = pnlReset.BackColor; pnlReset.Left = this.Width / 2 - pnlReset.Width / 2; pnlReset.Top = this.Height / 2 - pnlReset.Height / 2; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); SetupExceptionHandling(); ThemeService.SetThemeToUserSettings(); }
public async Task <IActionResult> Themes(Guid subjectId, int page = 0, int pageSize = 10) { var themes = await ThemeService.GetThemesForSubjectAsync(subjectId); var model = Mapper.Map <ICollection <ThemeModel>, ICollection <ThemeViewModel> >(themes); return(Ok(model)); }
public IEnumerable <Theme> Donner(ObjetDonnerListe odl) { ThemeService rs = new ThemeService(); return(rs.Donner(odl.ienum, odl.options).Select(j => j.VersAPI())); throw new NotImplementedException(); }
static int Run(string[] args) { var themePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, THEMES); var themeDir = new DirectoryInfo(themePath); if (!themeDir.Exists || themeDir.GetFiles(DNTHEME).Length == 0) { WriteMessage("请将{0}文件放到{1}文件夹下", DNTHEME, themePath); return(-1); } var outputPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, OUTPUTDIR); Directory.CreateDirectory(outputPath); var service = new ThemeService(); var xml = new XDocument(); foreach (var theme in service.AllThemes) { var rd = new ResourceDictionary(); var root = CreateRootElement(xml); var name = theme.Name ?? theme.Guid.ToString(); WriteMessage("正在处理{0}", name); foreach (var kv in theme.EnumerateResourceKeyValues()) { if (kv.Item2 is MediaColor color) { CreateColorElement(root, kv.Item1.ToString(), color); } else if (kv.Item2 is Brush brush) { CreateBrushElement(root, kv.Item1.ToString(), brush); } else if (kv.Item2 is LinearGradientBrush linearGradientBrush) { CreateLinearGradientBrushElement(root, kv.Item1.ToString(), linearGradientBrush); } else if (kv.Item2 is DrawingBrush drawingBrush) { CreateDrawingBrushElement(root, kv.Item1.ToString(), drawingBrush); } else { continue; } } var outFile = Path.Combine(outputPath, name) + ".xaml"; WriteMessage("输出资源字典文件{0}", outFile); xml.Save(outFile, SaveOptions.None); } WriteMessage("完成,按任意键退出..."); Console.ReadKey(); return(0); }
public void Should_throw_validation_errors_when_setting_selected_theme() { var storageProvider = new Mock <IStorageProvider>(); var preferencesService = new Mock <IPreferencesService>(); SetupMockCase(preferencesService, storageProvider); var service = new ThemeService(storageProvider.Object, preferencesService.Object, new Mock <IMapper>().Object); var themes = new List <ITheme> { new Theme() { IsSelected = true, Type = "Dark" }, new Theme() { IsSelected = false, Type = "Light" } }; Exception exception = null; try { service.SetSelected(themes, null); } catch (Exception ex) { exception = ex; } exception.GetType().Should().Be(typeof(ArgumentNullException)); exception = null; try { service.SetSelected(null, new Theme()); } catch (Exception ex) { exception = ex; } exception.GetType().Should().Be(typeof(ArgumentNullException)); exception = null; try { service.SetSelected(new List <ITheme>(), new Theme()); } catch (Exception ex) { exception = ex; } exception.GetType().Should().Be(typeof(ArgumentNullException)); }
public void InsertThemeTest() { Theme theme = new Theme(); theme.ThemeId = SnowFlake_Net.GenerateSnowFlakeID(); // theme.FriendLinksArray =new FriendLinks[]{ new FriendLinks() {FriendLinksId= SnowFlake_Net.GenerateSnowFlakeID() ,Title="A",Url="A"} }; ThemeService.InsertTheme(theme); Assert.Fail(); }
public Create() { InitializeComponent(); _testService = new TestService(); _themeService = new ThemeService(); txbTheme.ItemsSource = _themeService.GetAll().Select(x => x.Name).ToArray(); }
public async Task <ActionResult> CreateTheme(ThemeModel model) { ThemeDTO themeDto = new ThemeDTO { ThemeDesc = model.ThemeDesc, ThemeTitle = model.ThemeTitle, Id = RandomStringIdGenerator.GetUniqueId() }; await ThemeService.CreateNew(themeDto); return(RedirectToAction("Index", "Home")); }
/// <summary> /// CTR /// </summary> public ThemesController(ThemeService themes) { if (themes == null) { throw new ArgumentNullException("themes"); } _ThemeService = themes; }
public void GetThemesFromStringResource() { var fixture = new ThemeService(); var themes = fixture.GetThemes(WallpaperResource.Feeds); Assert.AreEqual("Wallpaper of the Day", themes.WallPaperOfTheDay.Name); Assert.AreEqual("Top 4 Wallpapers Today", themes.All.ToList()[1].Name); Assert.AreEqual(37, themes.All.Count()); }
public UserThemeService(UserConfigService configService, ThemeService themeService) { _configService = configService; _themeService = themeService; var userTheme = _configService.Get(ConfigSettings.Theme, "green"); _currentTheme = _themeService.GetThemeConfig(userTheme); }
public ProfileSelectViewModel( AccountService accountService, SkinService skinService, ThemeService themeService) { _accountService = accountService; _skinService = skinService; _themeService = themeService; }
protected override async Task OnInitializedAsync() { _tenants = await TenantService.GetTenantsAsync(); _urls = PageState.Alias.Name; _themeList = await ThemeService.GetThemesAsync(); _themes = ThemeService.GetThemeControls(_themeList); _siteTemplates = await SiteTemplateService.GetSiteTemplatesAsync(); }
public Startup(ThemeService themeService, WindowManager windowManager, TerminalHandler terminalHandler, GlobalHotkeys globalHotkeys, IConfig config, UpdateChecker updateChecker) { _themeService = themeService; _windowManager = windowManager; _terminalHandler = terminalHandler; _globalHotkeys = globalHotkeys; _config = config; _updateChecker = updateChecker; }
public UpdateViewModel( ThemeService themeService, UpdateService updateService, IWindowManager windowManager) { _updateService = updateService; _windowManager = windowManager; ThemeService = themeService; }
public async Task <ActionResult> EditTheme(string id) { ThemeDTO theme = await ThemeService.FindThemeDtoById(id); if (theme != null) { return(View(theme)); } return(HttpNotFound()); }
public async Task <ActionResult> Themes(Guid subjectId) { ViewBag.SubjectId = subjectId; var themes = await ThemeService.GetThemesForSubjectAsync(subjectId); var model = Mapper.Map <ICollection <ThemeModel>, ICollection <ThemeViewModel> >(themes); return(View(model)); }
private void InitTheme() { var themeService = new ThemeService(); Theme = themeService.Get(); StylesContent = themeService.GenerateStylesContent(); StylesHash = GetStringHash(StylesContent, new SHA256CryptoServiceProvider()); //StyleFrameworkContent = themeService.GenerateStyleFrameworkContent(); //StyleFrameworkHash = GetStringHash(StyleFrameworkContent, new SHA256CryptoServiceProvider()); }
private void LogIn_Load(object sender, EventArgs e) { ThemeService.ActiveTheme(this); lblTitle.Text = MyShopConfigration.ProjectName; this.Top = this.Top + 100; notifyIcon1.BalloonTipTitle = MyShopConfigration.ProjectName; lblTime.Text = DateTime.Now.ToString("t"); Functions.Notification(notifyIcon1, "Active theme : " + this.BackColor.Name.ToString() + " | System name: " + Environment.MachineName + " | Username: "******" | Developers: Nithin R Nair, Maheesh M - MCA 2013 - 16 KVVS IT - Adoor", 100); }
public async Task GetImageInformation() { var themeService = new ThemeService(); var themes = themeService.GetThemes(WallpaperResource.Feeds); var fixture = new RssReader(); var rssForFeed = await fixture.GetFeed(themes.WallPaperOfTheDay.FeedUrl); var images = fixture.GetImageMetaData(rssForFeed); Assert.IsNotNull(images.First().imageUrl); }