public async void DeleteThemeDialog(int id) { ContentDialog deleteDialog = new ContentDialog { Title = "Delete Theme Permanently?", Content = "If you delete this theme you will not be able to recover it. Are you sure you want to PERMANENTLY delete this Theme?", PrimaryButtonText = "Delete", CloseButtonText = "Cancel" }; ContentDialogResult result = await deleteDialog.ShowAsync(); if (result == ContentDialogResult.Primary) { // Delete the theme var theme = ThemeRepository.Find(id); if (theme == null) { return; } ThemeRepository.RemoveAndCommit(id); // Remove from the Themes List for (int i = Themes.Count - 1; i >= 0; i--) { if (Themes[i].ID == id) { Themes.RemoveAt(i); break; } } } }
public override void OnNavigatedTo() { Debug.WriteLine($"{nameof(ThemeListViewModel)} - {nameof(OnNavigatedTo)}"); Themes.Clear(); var tmp = ThemeRepository.GetAll(); foreach (var item in tmp) { Themes.Add(item); } // Print all the values to the screen to debug //foreach (var item in AccessTokenRepository.GetAll()) //{ // Debug.WriteLine($"Access Tokens: {item.Path} - {item.AccessTokenType} | {item.AccessToken}"); //} //foreach (var item in ThemeRepository.GetAll()) //{ // Debug.WriteLine($"Theme: {item.Name}"); //} //foreach (var item in DirectoryRepository.GetAll()) //{ // Debug.WriteLine($"Directories: {item.Path}"); //} }
public List <LookupModel> FetchThemes() { // Create repository var themeRepository = new ThemeRepository(); // FetchById the themes var themes = themeRepository.FetchAll(); // Build the return model var list = ( from DataRow row in themes.Rows select new LookupModel() { Id = (int)row["ThemeId"], Code = row["Code"].ToString(), Description = row["Description"].ToString(), SiteName = row["SiteName"].ToString() } ).ToList(); // Add empty item list.Insert(0, new LookupModel() { Id = null, Code = null, Description = "Site Theme" }); return(list); }
static Unit() { Context = new MyAppDbContext( new DbContextOptionsBuilder <MyAppDbContext>() .UseSqlServer(new SqlConnectionStringBuilder { DataSource = "127.0.0.1", InitialCatalog = "Univercity", IntegratedSecurity = true }.ConnectionString) .Options); Context.Database.EnsureDeleted(); Context.Database.EnsureCreated(); AuthorRepository = new AuthorRepository(Context); BookRepository = new BookRepository(Context); CategoryRepository = new CategoryRepository(Context); DepartmentRepository = new DepartmentRepository(Context); ECardRepository = new ECardsRepository(Context); EmployeeRepository = new EmploeeRepository(Context); FacultyRepository = new FacultyRepository(Context); GroupRepository = new GroupRepository(Context); LibrarianRepository = new LibrarianRepository(Context); PressRepository = new PressRepository(Context); SCardRepository = new SCardsRepository(Context); StudentRepository = new StudentRepository(Context); ThemeRepository = new ThemeRepository(Context); }
public static ThemeController Create(Context context) { var themeRepository = new ThemeRepository(context); var themeService = new ThemeService(themeRepository); var themeController = new ThemeController(themeService); return(themeController); }
static public void addTheme(Theme Theme) { using (ThemeRepository Themerepo = new ThemeRepository()) { Themerepo.Add(Theme); Themerepo.Save(); } }
public List <ThemeDto> GetThemeList() { var themeRepository = new ThemeRepository(); var themeList = themeRepository.GetListOfTheme(); return(themeList.Select(x => x.ToThemeDto()).ToList()); }
public HomeController() { this.httpClient = new HttpClient(); this.reservationRepository = new ReservationRepository(new ExcursionContext()); this.themeRepository = new ThemeRepository(new ExcursionContext()); this.sortieParSemaineRepository = new SortieParSemaineRepository(new ExcursionContext()); this.jourRepository = new JourRepository(new ExcursionContext()); this.typeExcRepository = new TypeExcRepository(new ExcursionContext()); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); CartesianArea area = this.radChartView1.GetArea <CartesianArea>(); area.ShowGrid = true; this.radDropDownList1.SelectedIndex = 0; LinearAxis verticalAcix = new LinearAxis(); verticalAcix.AxisType = AxisType.Second; CategoricalAxis horizontalAxis = new CategoricalAxis(); PerformanceModel model = new PerformanceModel(); for (int i = 0; i < 4; i++) { BarSeries barSeries = new BarSeries("Performance", "RepresentativeName"); barSeries.Name = "Q" + (i + 1); barSeries.HorizontalAxis = horizontalAxis; barSeries.VerticalAxis = verticalAcix; barSeries.DataSource = model.GetData(i); this.radChartView1.Series.Add(barSeries); foreach (DataPointElement pointElement in barSeries.Children) { pointElement.BorderWidth = 0; } } Theme theme = Theme.ReadCSSText(@" theme { name: ControlDefault; elementType: Telerik.WinControls.UI.RadChartElement; controlType: Telerik.WinControls.UI.RadChartView; } Bar { HeightAspectRatio { Value: 0.9; EndValue: 1; MaxValue: 1; Frames: 30; Interval: 20; EasingType: InOutCubic; RandomDelay: 200; RemoveAfterApply: true; } } "); ThemeRepository.Add(theme, false); }
public void Should_return_theme_by_folder() { using (var context = new WeapsyDbContext(_contextOptions)) { var repository = new ThemeRepository(Shared.CreateNewContextFactory(context), Shared.CreateNewMapper()); var theme = repository.GetByFolder("Folder 1"); Assert.NotNull(theme); } }
public void Should_return_null_if_theme_is_deleted() { using (var context = new WeapsyDbContext(_contextOptions)) { var repository = new ThemeRepository(Shared.CreateNewContextFactory(context), Shared.CreateNewMapper()); var theme = repository.GetById(_deletedThemeId); Assert.Null(theme); } }
public void Should_return_theme_by_name() { using (var context = new MSSQLDbContext(_contextOptions)) { var repository = new ThemeRepository(DbContextShared.CreateNewContextFactory(context), Shared.CreateNewMapper()); var theme = repository.GetByName("Name 1"); Assert.NotNull(theme); } }
public RoomsController( RoomRepository roomRepository, ThemeRepository themeRepository, IMapper mapper) { this.roomRepository = roomRepository; this.themeRepository = themeRepository; this.mapper = mapper; this.random = new Random(); }
public void Should_return_themes_count() { using (var context = new WeapsyDbContext(_contextOptions)) { var repository = new ThemeRepository(Shared.CreateNewContextFactory(context), Shared.CreateNewMapper()); var count = repository.GetThemesCount(); Assert.AreEqual(2, count); } }
public ExcursionController() { this.zoneRepository = new ZoneRepository(new ExcursionContext()); this.excursionRepository = new ExcursionRepository(new ExcursionContext()); this.userRepository = new UserRepository(new ExcursionContext()); this.periodeRepository = new PeriodeRepository(new ExcursionContext()); this.prixRepository = new PrixRepository(new ExcursionContext()); this.excursionThemeRepository = new ExcursionThemeRepository(new ExcursionContext()); this.themeRepository = new ThemeRepository(new ExcursionContext()); }
static public List <Theme> GetAllThemeswithoutdetaching() { List <Theme> Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = (List <Theme>)Themerepo.GetAll(); } return(Themetemp); }
static public Theme GetThemeByName(string Themename) { Theme Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = Themerepo.GetSingleByName(Themename); } return(Themetemp); }
static public Theme GetTheme(int Themeid) { Theme Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = Themerepo.GetSingle(Themeid); } return(Themetemp); }
public CourseTest() { var dbContext = new FacultyDbContext("FacultyContext"); var themeRepository = new ThemeRepository(dbContext); var courseRepository = new CourseRepository(dbContext); var userRepository = new UserRepository(dbContext); _userService = new UserService(userRepository); _courseService = new BusinessLogicLayer.Services.CourseService(courseRepository, _userService); _themeService = new BusinessLogicLayer.Services.ThemeService(themeRepository, _courseService); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.radChartView1.Controllers.Add(new ChartSelectionController()); this.radChartView1.Controllers.Add(new SmartLabelsController() { Strategy = new PieTwoLabelColumnsStrategy() }); var toolTipController = new ChartTooltipController(); toolTipController.DataPointTooltipTextNeeded += ToolTipController_DataPointTooltipTextNeeded; this.radChartView1.Controllers.Add(toolTipController); this.radChartView1.SelectionMode = Telerik.WinControls.UI.ChartSelectionMode.MultipleDataPoints; this.radChartView1.SelectedPointChanged += new ChartViewSelectedChangedEventHandler(selectionController_SelectedPointChanged); //this.radChartView1.ShowLegend = true; //this.radChartView1.ChartElement.LegendElement.Font = this.radChartView1.Font; this.pieSeries = new PieSeries(); this.pieSeries.ShowLabels = true; this.pieSeries.DrawLinesToLabels = true; this.pieSeries.SyncLinesToLabelsColor = true; this.pieSeries.Font = this.radChartView1.Font; this.pieSeries.RadiusFactor = 0.9f; this.pieSeries.Range = new AngleRange(270, 360); Theme theme = Theme.ReadCSSText(@" theme { name: ControlDefault; elementType: Telerik.WinControls.UI.RadChartElement; controlType: Telerik.WinControls.UI.RadChartView; } PieSegment { RadiusAspectRatio { Value: 0.5; EndValue: 1; MaxValue: 1; Frames: 20; Interval: 10; EasingType: OutCircular; RandomDelay: 100; RemoveAfterApply: true; } } "); ThemeRepository.Add(theme, false); }
public void Default_values_are_specified_in_invariant_theme() { var repository = new ThemeRepository(new ThemePersistence()); var invariantTheme = repository.GetInvariantTheme(); invariantTheme.Should().NotBeNull(); foreach (AppColor name in Enum.GetValues(typeof(AppColor))) { Color value = invariantTheme.GetColor(name); value.Should().NotBe(Color.Empty); } }
public Theme GetThemeByName(string Themename) { Theme Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = Themerepo.GetSingleByName(Themename); Themerepo.context.Entry(Themetemp).State = EntityState.Detached; } return(Themetemp); }
static void Main(string[] args) { ThemeRepository themeRep = new ThemeRepository(); QuestionRepository questRep = new QuestionRepository(); Question q = new Question() { Text = "question qqq", ThemeId=11, }; questRep.Add(q); Console.ReadKey(); }
public void Default_values_are_specified_in_invariant_theme() { var themePathProvider = new ThemePathProvider(); var themeLoader = new ThemeLoader(new ThemeCssUrlResolver(themePathProvider), new ThemeFileReader()); var repository = new ThemeRepository(new ThemePersistence(themeLoader), themePathProvider); var invariantTheme = repository.GetInvariantTheme(); invariantTheme.Should().NotBeNull(); foreach (AppColor name in Enum.GetValues(typeof(AppColor))) { Color value = invariantTheme.GetColor(name); value.Should().NotBe(Color.Empty); } }
static public List <Theme> GetAllThemes(Audit audit) { List <Theme> Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = (List <Theme>)Themerepo.GetAll(); foreach (Theme theme in Themetemp) { Themerepo.context.Entry(theme).State = EntityState.Detached; } List <int> ResultPoints = new List <int>(); foreach (var item in audit.resultats) { ResultPoints.Add(item.point.PointID); } List <Point> PointTemp1 = new List <Point>(); //foreach (var item in ServicePoint.GetAllPoints()) //{ //} foreach (var theme in Themetemp) { PointTemp1.Clear(); foreach (var item1 in theme.points) { PointTemp1.Add(item1); } //for (int i = 0; i < PointTemp1.Count; i++) //{ // if (!ResultPoints.Contains(point.PointID)) // { // theme.points.Remove(point); // } //} foreach (var point in PointTemp1) { if (!ResultPoints.Contains(point.PointID)) { theme.points.Remove(point); } } } } return(Themetemp); }
public void PopulatesInternalThemeList() { ThemeRepository repository = new ThemeRepository(); var listOfThemes = repository.Themes; Assert.Less(0, listOfThemes.Count, "Expected at least one theme."); Console.WriteLine(listOfThemes.Count); //Don't expect any empty themes foreach (var wordList in listOfThemes) { Console.WriteLine($"Theme {wordList.Key} has {wordList.Value.Count} words."); Assert.Less(0, wordList.Value.Count, $"Theme {wordList.Key} was empty!"); } }
static public List <Theme> GetAllThemes() { List <Theme> Themetemp = null; using (ThemeRepository Themerepo = new ThemeRepository()) { Themetemp = (List <Theme>)Themerepo.GetAll(); foreach (Theme theme in Themetemp) { Themerepo.context.Entry(theme).State = EntityState.Detached; } } return(Themetemp); }
public void Allow_A_Theme_To_Be_Added_For_A_Parser() { // arrange var repo = new ThemeRepository() { Themes = new Dictionary <string, Theme>() { ["a"] = Theme.Cool } }; // act repo.SetTheme("a", Theme.Warm); // assert repo.Get("a").Should().BeSameAs(Theme.Warm); }
protected internal virtual bool IsFullScreenTheme() { foreach (PropertySettingGroup propertySettingGroup in ThemeRepository.FindTheme(!string.IsNullOrEmpty(ThemeResolutionService.ApplicationThemeName) ? ThemeResolutionService.ApplicationThemeName : ((RadControl)this.ElementTree.Control).ThemeName).FindStyleGroup("Telerik.WinControls.UI.RadRibbonBarBackstageView").PropertySettingGroups) { if (propertySettingGroup.Selector.Value == nameof(BackstageViewElement)) { foreach (PropertySetting propertySetting in propertySettingGroup.PropertySettings) { if (propertySetting.Name == "IsFullScreen") { return((bool)propertySetting.Value); } } } } return(false); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); this.radLabel4.Visible = false; this.radSpinDonutRadius.Visible = false; this.radChartView1.Controllers.Add(new ChartSelectionController()); this.radChartView1.SelectedPointChanged += new ChartViewSelectedChangedEventHandler(selectionController_SelectedPointChanged); BindSelectionModeCombo(); this.radDropDownList1.SelectedValueChanged += new EventHandler(radDropDownList1_SelectedValueChanged); this.radDropDownList1.SelectedValue = ChartSelectionMode.SingleDataPoint; this.pieSeries = new PieSeries(); this.PopulatePieSeries(); this.radChartView1.Series.Clear(); this.radChartView1.Series.Add(this.pieSeries); Theme theme = Theme.ReadCSSText(@" theme { name: ControlDefault; elementType: Telerik.WinControls.UI.RadChartElement; controlType: Telerik.WinControls.UI.RadChartView; } PieSegment { RadiusAspectRatio { Value: 0.5; EndValue: 1; MaxValue: 1; Frames: 20; Interval: 10; EasingType: OutCircular; RandomDelay: 100; RemoveAfterApply: true; } } "); ThemeRepository.Add(theme, false); }
public UnitOfWork(ApplicationContext context) { _context = context; _context.Configuration.AutoDetectChangesEnabled = false; Answers = new AnswerRepository(_context); Questions = new QuestionRepository(_context); Results = new ResultRepository(_context); Tests = new TestRepository(_context); Themes = new ThemeRepository(_context); UserInfoes = new UserInfoRepository(_context); TempResults = new TempResultRepository(_context); UserQuestions = new UserQuestionsRepository(_context); UserAnswers = new UserAnswersRepository(_context); ApplicationRoleManagers = new ApplicationRoleManager (new RoleStore <ApplicationRole>(_context)); ApplicationUserManagers = new ApplicationUserManager (new UserStore <ApplicationUser>(_context)); }