public void InitializeComponent() { using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["DB_Game"].ConnectionString)) { if (Studios != null) { Studios.Clear(); } Studios = new ObservableCollection <Studio>(db.Query <Studio>("SELECT * FROM [Studio]").ToList()); if (Styles != null) { Styles.Clear(); } Styles = new ObservableCollection <Model.Base.Style>(db.Query <Model.Base.Style>("SELECT * FROM [Style]").ToList()); if (Mod_s != null) { Mod_s.Clear(); } Mod_s = new ObservableCollection <Mod_Game>(db.Query <Mod_Game>("SELECT * FROM [Mod_Game]").ToList()); if (Games != null) { Games.Clear(); } Games = new ObservableCollection <Game>(db.Query <Game>("SELECT * FROM [Game]").ToList()); Games.ToList().ForEach(i => i.Studio = Studios.ToList().Find(j => j.Id == i.Game_Studio_id)); Games.ToList().ForEach(i => i.Style = Styles.ToList().Find(j => j.Id == i.Game_Style_id)); Games.ToList().ForEach(i => i.Mod_Game = Mod_s.ToList().Find(j => j.Id == i.Game_Mod_id)); OnPropertyChanged("Games"); } }
/// <summary> /// Remove all styles /// </summary> public void Clear() { if (HasStyleAttribute) { Styles.Clear(); } }
internal void Begin() { Attributes.Clear(); Styles.Clear(); InnerText = new StringBuilder(); RawInnerText = new StringBuilder(); }
/// <summary> /// Remove all styles /// </summary> public void Clear() { if (_Styles != null) { Styles.Clear(); } QuickSetValue = null; }
public void Reset() { Initialized = false; eventId = 0; lastUpdateTime = DateTime.UtcNow; Sites.Clear(); Coords.Clear(); Types.Clear(); Styles.Clear(); Sizes.Clear(); Services.Clear(); Updates.Clear(); }
protected TextBoxContainer(string name, Docking dock) : base(name, dock, null) { TB = new TextBox("text", null, true); TB.Dock = Docking.Fill; AddChild(TB); MaxSize = TB.MaxSize; /*** ***/ //Styles = new WidgetStyleProvider (new TextBoxWidgetStyle ()); Styles.Clear(); Styles.SetStyle(new TextBoxWidgetStyle(), WidgetStates.Default); Styles.SetStyle(new TextBoxActiveWidgetStyle(), WidgetStates.Active); Styles.SetStyle(new TextBoxDisabledWidgetStyle(), WidgetStates.Disabled); }
public void AddStyle(List <styleurl> styles) { // Reset Styles Styles.Clear(); // Add each style foreach (var style in styles) { _style s = new _style(); s.id = style.ID; s.eventId = style.idIPMEvent; s.poly_color = style.backgroundColor; s.styleUrl = style.styleUrl1; Styles.Add(s); } }
public void Removing_Style_With_Resources_Should_Raise_ResourceChanged() { var target = new Styles { new Style { Resources = { { "foo", "bar" } }, } }; var raised = false; target.ResourcesChanged += (_, __) => raised = true; target.Clear(); Assert.True(raised); }
public virtual void Clear(bool RaiseChangedEvent) { if (RaiseChangedEvent) { ResourceID = 0; ResourceName = String.Empty; FullString = String.Empty; Variables.Clear(); Styles.Clear(); } else { resourceID = 0; resourceName = String.Empty; fullString = String.Empty; Variables.Clear(); Styles.Clear(); } }
public ComboBox(string name) : base(name) { TB = new TextBox("TextBox", null, true); TB.Dock = Docking.Fill; Children.Add(TB); InsertButton(); //TB.ReadOnly = true; TextMargin = new Size(6, 2); ItemHeight = TB.Font.TextBoxHeight; //Styles = new WidgetStyleProvider (new TextBoxWidgetStyle ()); Styles.Clear(); Styles.SetStyle(new TextBoxWidgetStyle(), WidgetStates.Default); Styles.SetStyle(new TextBoxActiveWidgetStyle(), WidgetStates.Active); Styles.SetStyle(new TextBoxDisabledWidgetStyle(), WidgetStates.Disabled); }
private void SetDarkTheme() { var theme = new Avalonia.Themes.Fluent.FluentTheme(new System.Uri("avares://Avalonia.Themes.Fluent/FluentTheme.xaml")); var oxyPlotUri = new System.Uri("resm:OxyPlot.Avalonia.Themes.Default.xaml?assembly=OxyPlot.Avalonia"); var darkUri = new System.Uri("avares://PingLogger/Themes/Dark.axaml"); var darkXAML = new StyleInclude(darkUri) { Source = darkUri }; var oxyPlotTheme = new StyleInclude(oxyPlotUri) { Source = oxyPlotUri }; Styles.Clear(); theme.Mode = Avalonia.Themes.Fluent.FluentThemeMode.Dark; Styles.Add(oxyPlotTheme); Styles.Add(theme); Styles.Add(darkXAML); DarkMode = true; }
private void SetLightTheme() { var theme = new Avalonia.Themes.Fluent.FluentTheme(new System.Uri("avares://Avalonia.Themes.Fluent/FluentTheme.xaml")); var oxyPlotUri = new System.Uri("resm:OxyPlot.Avalonia.Themes.Default.xaml?assembly=OxyPlot.Avalonia"); var lightUri = new System.Uri("avares://PingLogger/Themes/Light.axaml"); var lightXAML = new StyleInclude(lightUri) { Source = lightUri }; var oxyPlotTheme = new StyleInclude(oxyPlotUri) { Source = oxyPlotUri }; Styles.Clear(); theme.Mode = Avalonia.Themes.Fluent.FluentThemeMode.Light; Styles.Add(oxyPlotTheme); Styles.Add(theme); Styles.Add(lightXAML); DarkMode = false; }
async Task ReloadStyles() { Styles.Clear(); EntityResponse <List <Style> > resultFromApi; try { resultFromApi = await ApiService.GetStyles().SetIsLoading(this); } catch (Exception) { return; } if (resultFromApi.Status == Status.Failure) { return; } resultFromApi.Data.ForEach(s => Styles.Add(s)); }
public void CreateStyles() { Styles.Clear(); Dictionary <string, string> icon = new Dictionary <string, string>(); icon.Add("height", "40px"); icon.Add("width", "120px"); icon.Add("font-size", "20px"); icon.Add("position", "absolute"); icon.Add("left", "0px"); icon.Add("background", "#AAAAAA"); Styles.Add(".icon", icon); Dictionary <string, string> header = new Dictionary <string, string>(); header.Add("height", "40px"); header.Add("width", "1028px"); header.Add("margin", "0 auto"); header.Add("background", "#777777"); header.Add("position", "relative"); header.Add("left", "0px"); header.Add("top", "0px"); Styles.Add(".header", header); Dictionary <string, string> content = new Dictionary <string, string>(); content.Add("width", "1028px"); content.Add("margin", "0 auto"); Styles.Add(".content", content); Dictionary <string, string> links = new Dictionary <string, string>(); links.Add("height", "25px"); links.Add("width", "1028px"); links.Add("margin", "0 auto"); links.Add("background", "#DDDDDD"); Styles.Add(".links", links); Dictionary <string, string> links_ul = new Dictionary <string, string>(); links_ul.Add("list-style", "none"); links_ul.Add("padding", "2"); links_ul.Add("margin", "2"); Styles.Add(".links ul", links_ul); Dictionary <string, string> links_li = new Dictionary <string, string>(); links_li.Add("display", "inline"); links_li.Add("float", "left"); Styles.Add(".links li", links_li); Dictionary <string, string> links_a = new Dictionary <string, string>(); links_a.Add("text-decoration", "none"); links_a.Add("display", "block"); links_a.Add("color", "#000000"); links_a.Add("background", "#DDDDDD"); links_a.Add("width", "120px"); links_a.Add("font-family", "arial"); links_a.Add("font-size", "1.1em"); Styles.Add(".links a", links_a); Dictionary <string, string> links_aHover = new Dictionary <string, string>(); links_aHover.Add("background", "#EEEEEE"); links_aHover.Add("color", "#333333"); Styles.Add(".links a:hover", links_aHover); }