public void Clear(string defaultimage) { manualClear = true; cb_tile.IsChecked = false; btn_color.Background = SomeUtilities.GetBrushFromHex("#FFFFFFFF"); tb_path.Text = defaultimage; manualClear = false; }
public static double getOpacityFromHex(string hexString) { Brush br = SomeUtilities.GetBrushFromHex(hexString); double a = ((Color)br.GetValue(SolidColorBrush.ColorProperty)).A; double max = 255; double opacityval = (a / max); return(opacityval); }
public void Clear() { manualClear = true; tb_fontPath.Text = "./../SomeArt/font.ttf"; tb_fontSize.Text = "0.03"; btn_iconColor.Foreground = SomeUtilities.GetBrushFromHex("#777777FF"); btn_textColor.Foreground = SomeUtilities.GetBrushFromHex("#777777FF"); manualClear = false; }
public void Clear() { manualClear = true; btn_color.Foreground = SomeUtilities.GetBrushFromHex("#777777FF"); tb_fontPath.Text = "./../SomeArt/font.ttf"; tb_fontSize.Text = "0.03"; //tb_lineSpacing.Text = "1.5"; manualClear = false; }
public void Clear() { manualClear = true; cbx_type.SelectedValue = "horizontal"; tb_logoScale.Text = "1.2"; btn_color.Foreground = SomeUtilities.GetBrushFromHex("#FF777777"); tb_maxLogoCount.Text = "5"; tb_logoSize_w.Text = "0.125"; tb_logoSize_h.Text = "0.155"; manualClear = false; }
public void Clear() { manualClear = true; tb_fontPath.Text = "./../SomeArt/font.ttf"; tb_fontSize.Text = "0.03"; cb_forceUppercase.IsChecked = false; btn_color.Foreground = SomeUtilities.GetBrushFromHex("#FF000000"); tb_lineSpacing.Text = "1.5"; tb_text.Text = ""; cbx_alignment.SelectedValue = "center"; manualClear = false; }
public void Clear() { manualClear = true; cbx_alignment.SelectedValue = "center"; tb_fontPath.Text = "./../SomeArt/font.ttf"; tb_scrollSound.Text = "./../SomeArt/scrollsound.ogg"; tb_fontSize.Text = "0.03"; cb_forceUppercase.IsChecked = false; btn_secondaryColor.Foreground = SomeUtilities.GetBrushFromHex("#FF777777"); btn_selectedColor.Foreground = SomeUtilities.GetBrushFromHex("#FFe2ead9"); btn_selectorColor.Foreground = SomeUtilities.GetBrushFromHex("#77ffa500"); btn_primaryColor.Foreground = SomeUtilities.GetBrushFromHex("#FF440040"); tb_lineSpacing.Text = "1.5"; manualClear = false; }
public void setProperty(string name, string value) { if (name == "") { return; } switch (name) { case "text": if (value != "") { somestring = value; } fill(forceUppercase); break; case "alignment": if (value.ToLower() == "center") { date.TextAlignment = TextAlignment.Center; } if (value.ToLower() == "right") { date.TextAlignment = TextAlignment.Right; } if (value.ToLower() == "left") { date.TextAlignment = TextAlignment.Left; } break; case "color": if (color != value) { color = value; date.Foreground = SomeUtilities.GetBrushFromHex(value); } break; case "fontSize": double fontsize; if (!double.TryParse(value.Replace(".", ","), out fontsize)) { return; } if (fontsize > 0) { fontsize = ((App)Application.Current).Height * fontsize; date.FontSize = fontsize; this.Visibility = System.Windows.Visibility.Visible; } else { this.Visibility = System.Windows.Visibility.Hidden; } break; case "fontPath": value = SomeUtilities.MakeAbsolutePath(((App)Application.Current).themefolder + ((App)Application.Current).gameplatformtheme + "\\theme.xml", value); if (File.Exists(value)) { PrivateFontCollection fileFonts = new PrivateFontCollection(); fileFonts.AddFontFile(value); value = value.Replace(System.IO.Path.GetFileName(value), "#" + fileFonts.Families[0].Name).Replace("\\", "/"); date.FontFamily = new FontFamily("file:///" + value); this.Visibility = System.Windows.Visibility.Visible; date.UpdateLayout(); } else { this.Visibility = System.Windows.Visibility.Hidden; } break; case "forceUppercase": if (value == "1") { forceUppercase = true; } if (value == "0") { forceUppercase = false; } fill(forceUppercase); break; } fill(forceUppercase); }
public void addPropertie(string name, string value) { if (name == "") { return; } element.addPropertie(name, value); if (name == "extra") { element.extra = value; } else { switch (element.typeOfElement.ToString()) { case "text": if (string.IsNullOrEmpty(textControl.somestring)) { textControl.somestring = description; } textControl.setProperty(name, value); if (textControl.Visibility == System.Windows.Visibility.Visible) { showVisual(true); } break; case "image": case "rating": imageControl.setProperty(name, value); if (imageControl.Visibility == System.Windows.Visibility.Visible) { showVisual(true); } break; case "textlist": textListControl.setProperty(name, value); if (textListControl.Visibility == System.Windows.Visibility.Visible) { showVisual(true); } break; case "datetime": if (string.IsNullOrEmpty(textControl.somestring)) { DateTime dt = DateTime.Now; textControl.somestring = dt.ToString(); } textControl.setProperty(name, value); if (textControl.Visibility == System.Windows.Visibility.Visible) { showVisual(true); } break; case "carousel": if (name == "type") { if (value == "vertical") { this.Width = ((App)Application.Current).Width * 0.2291666666666667; this.Height = ((App)Application.Current).Height; Canvas.SetLeft(this, 0); Canvas.SetTop(this, 0); horizontalResizing = true; verticallResizing = false; } else { this.Width = ((App)Application.Current).Width; this.Height = ((App)Application.Current).Height * 0.2291666666666667; Canvas.SetLeft(this, 0); Canvas.SetTop(this, ((App)Application.Current).Height / 2 - (((App)Application.Current).Height * 0.2291666666666667) / 2); horizontalResizing = false; verticallResizing = true; } } if (name == "color") { rectangle.Fill = SomeUtilities.GetBrushFromHex(value); } break; case "helpsystem": break; } } }