public static void InitGeneralControlLayout( System.Web.UI.WebControls.WebControl MyControl, System.Drawing.Color BackColor, System.Drawing.Color BorderColor, System.Web.UI.WebControls.BorderStyle BorderStyle, string AccessKey, System.Web.UI.WebControls.Unit BorderWidth, string MyCsClass, bool visible, System.Web.UI.WebControls.Unit Width, System.Web.UI.WebControls.Unit Height, System.Drawing.Color ForeColor ) { MyControl.BackColor = BackColor; MyControl.BorderColor = BorderColor; MyControl.BorderStyle = BorderStyle; MyControl.AccessKey = AccessKey; MyControl.BorderWidth = BorderWidth; MyControl.CssClass = MyCsClass; MyControl.Visible = visible; MyControl.Width = Width; MyControl.Height = Height; MyControl.ForeColor = ForeColor; }
protected override void Initialize(DataRow schemeData) { if (schemeData != null) { this.FontName = BaseAutoFormat <Wizard> .GetStringProperty("FontName", schemeData); this.FontSize = new FontUnit(BaseAutoFormat <Wizard> .GetStringProperty("FontSize", schemeData), CultureInfo.InvariantCulture); this.BackColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("BackColor", schemeData)); this.BorderColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("BorderColor", schemeData)); this.BorderWidth = new Unit(BaseAutoFormat <Wizard> .GetStringProperty("BorderWidth", schemeData), CultureInfo.InvariantCulture); this.SideBarStyleBackColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("SideBarStyleBackColor", schemeData)); this.SideBarStyleVerticalAlign = (VerticalAlign)BaseAutoFormat <Wizard> .GetIntProperty("SideBarStyleVerticalAlign", schemeData); this.BorderStyle = (System.Web.UI.WebControls.BorderStyle) BaseAutoFormat <Wizard> .GetIntProperty("BorderStyle", schemeData); this.NavigationButtonStyleBorderWidth = new Unit(BaseAutoFormat <Wizard> .GetStringProperty("NavigationButtonStyleBorderWidth", schemeData), CultureInfo.InvariantCulture); this.NavigationButtonStyleFontName = BaseAutoFormat <Wizard> .GetStringProperty("NavigationButtonStyleFontName", schemeData); this.NavigationButtonStyleFontSize = new FontUnit(BaseAutoFormat <Wizard> .GetStringProperty("NavigationButtonStyleFontSize", schemeData), CultureInfo.InvariantCulture); this.NavigationButtonStyleBorderStyle = (System.Web.UI.WebControls.BorderStyle) BaseAutoFormat <Wizard> .GetIntProperty("NavigationButtonStyleBorderStyle", schemeData); this.NavigationButtonStyleBorderColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("NavigationButtonStyleBorderColor", schemeData)); this.NavigationButtonStyleForeColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("NavigationButtonStyleForeColor", schemeData)); this.NavigationButtonStyleBackColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("NavigationButtonStyleBackColor", schemeData)); this.StepStyleBorderWidth = new Unit(BaseAutoFormat <Wizard> .GetStringProperty("StepStyleBorderWidth", schemeData), CultureInfo.InvariantCulture); this.StepStyleBorderStyle = (System.Web.UI.WebControls.BorderStyle) BaseAutoFormat <Wizard> .GetIntProperty("StepStyleBorderStyle", schemeData); this.StepStyleBorderColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("StepStyleBorderColor", schemeData)); this.StepStyleForeColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("StepStyleForeColor", schemeData)); this.StepStyleBackColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("StepStyleBackColor", schemeData)); this.StepStyleFontSize = new FontUnit(BaseAutoFormat <Wizard> .GetStringProperty("StepStyleFontSize", schemeData), CultureInfo.InvariantCulture); this.SideBarButtonStyleFontUnderline = BaseAutoFormat <Wizard> .GetBooleanProperty("SideBarButtonStyleFontUnderline", schemeData); this.SideBarButtonStyleFontName = BaseAutoFormat <Wizard> .GetStringProperty("SideBarButtonStyleFontName", schemeData); this.SideBarButtonStyleForeColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("SideBarButtonStyleForeColor", schemeData)); this.SideBarButtonStyleBorderWidth = new Unit(BaseAutoFormat <Wizard> .GetStringProperty("SideBarButtonStyleBorderWidth", schemeData), CultureInfo.InvariantCulture); this.SideBarButtonStyleBackColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("SideBarButtonStyleBackColor", schemeData)); this.HeaderStyleForeColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("HeaderStyleForeColor", schemeData)); this.HeaderStyleBorderColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("HeaderStyleBorderColor", schemeData)); this.HeaderStyleBackColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("HeaderStyleBackColor", schemeData)); this.HeaderStyleFontSize = new FontUnit(BaseAutoFormat <Wizard> .GetStringProperty("HeaderStyleFontSize", schemeData), CultureInfo.InvariantCulture); this.HeaderStyleFontBold = BaseAutoFormat <Wizard> .GetBooleanProperty("HeaderStyleFontBold", schemeData); this.HeaderStyleBorderWidth = new Unit(BaseAutoFormat <Wizard> .GetStringProperty("HeaderStyleBorderWidth", schemeData), CultureInfo.InvariantCulture); this.HeaderStyleHorizontalAlign = (HorizontalAlign)BaseAutoFormat <Wizard> .GetIntProperty("HeaderStyleHorizontalAlign", schemeData); this.HeaderStyleBorderStyle = (System.Web.UI.WebControls.BorderStyle) BaseAutoFormat <Wizard> .GetIntProperty("HeaderStyleBorderStyle", schemeData); this.SideBarStyleBackColor = ColorTranslator.FromHtml(BaseAutoFormat <Wizard> .GetStringProperty("SideBarStyleBackColor", schemeData)); this.SideBarStyleVerticalAlign = (VerticalAlign)BaseAutoFormat <Wizard> .GetIntProperty("SideBarStyleVerticalAlign", schemeData); this.SideBarStyleFontSize = new FontUnit(BaseAutoFormat <Wizard> .GetStringProperty("SideBarStyleFontSize", schemeData), CultureInfo.InvariantCulture); this.SideBarStyleFontUnderline = BaseAutoFormat <Wizard> .GetBooleanProperty("SideBarStyleFontUnderline", schemeData); this.SideBarStyleFontStrikeout = BaseAutoFormat <Wizard> .GetBooleanProperty("SideBarStyleFontStrikeout", schemeData); this.SideBarStyleBorderWidth = new Unit(BaseAutoFormat <Wizard> .GetStringProperty("SideBarStyleBorderWidth", schemeData), CultureInfo.InvariantCulture); } }
public void SelectElement(HtmlElement element, web.BorderStyle borderStyle, Color borderColor) { if (element != null) { zHighlightElement(element, false); zSelectElement(element, borderStyle, borderColor, false); } }
public ElementSelector(WebBrowser browser) { m_HighlightBorderStyle = web.BorderStyle.Solid; m_HighlightBorderColor = Color.Red; m_SelectBorderStyle = web.BorderStyle.Solid; m_SelectBorderColor = Color.Green; m_MaxUserSelectionCount = Int32.MaxValue; m_SelectedElements = new Dictionary <HtmlElement, string>(); m_ModifiedTables = new Dictionary <HtmlElement, string>(); m_Lock = new object(); m_Browser = browser; }
private void zSelectElement(HtmlElement element, web.BorderStyle borderStyle, Color borderColor, bool fromUserAction) { if (!m_SelectedElements.ContainsKey(element)) { m_SelectedElements.Add(element, m_HighlightedElementStyle); element.Style = String.Format("{0}; {1}", m_HighlightedElementStyle, zGetStyleString(borderStyle, borderColor)); if (fromUserAction) { m_UserSelectionCount++; } zOnElementSelected(new ElementSelectorEventArgs(element, fromUserAction)); } }
/// <summary> /// TODO: Add comment. /// </summary> public BorderProperties(Color c, System.Web.UI.WebControls.BorderStyle s, string w) { color = c; style = s; width = w; }
protected override void Initialize(DataRow schemeData) { if (schemeData != null) { this.Width = new Unit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("Width", schemeData), CultureInfo.InvariantCulture); this.Height = new Unit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("Height", schemeData), CultureInfo.InvariantCulture); this.FontName = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("FontName", schemeData); this.FontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("FontSize", schemeData), CultureInfo.InvariantCulture); this.ForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("ForeColor", schemeData)); this.BackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("BackColor", schemeData)); this.BorderColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("BorderColor", schemeData)); this.BorderWidth = new Unit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("BorderWidth", schemeData), CultureInfo.InvariantCulture); this.BorderStyle = (System.Web.UI.WebControls.BorderStyle)Enum.Parse(typeof(System.Web.UI.WebControls.BorderStyle), BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("BorderStyle", schemeData, "NotSet")); this.ShowGridLines = bool.Parse(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("ShowGridLines", schemeData, "false")); this.CellPadding = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("CellPadding", schemeData, 2); this.CellSpacing = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("CellSpacing", schemeData); this.DayNameFormat = (System.Web.UI.WebControls.DayNameFormat)Enum.Parse(typeof(System.Web.UI.WebControls.DayNameFormat), BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayNameFormat", schemeData, "Short")); this.NextPrevBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("NextPrevBackColor", schemeData)); this.NextPrevFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("NextPrevFont", schemeData); this.NextPrevFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("NextPrevFontSize", schemeData), CultureInfo.InvariantCulture); this.NextPrevForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("NextPrevForeColor", schemeData)); this.NextPrevFormat = (System.Web.UI.WebControls.NextPrevFormat)Enum.Parse(typeof(System.Web.UI.WebControls.NextPrevFormat), BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("NextPrevFormat", schemeData, "CustomText")); this.NextPrevVerticalAlign = (VerticalAlign)Enum.Parse(typeof(VerticalAlign), BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("NextPrevVerticalAlign", schemeData, "NotSet")); this.TitleFormat = (System.Web.UI.WebControls.TitleFormat)Enum.Parse(typeof(System.Web.UI.WebControls.TitleFormat), BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TitleFormat", schemeData, "MonthYear")); this.TitleBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TitleBackColor", schemeData)); this.TitleBorderColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TitleBorderColor", schemeData)); this.TitleBorderStyle = (System.Web.UI.WebControls.BorderStyle)Enum.Parse(typeof(System.Web.UI.WebControls.BorderStyle), BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("BorderStyle", schemeData, "NotSet")); this.TitleBorderWidth = new Unit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TitleBorderWidth", schemeData), CultureInfo.InvariantCulture); this.TitleFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("TitleFont", schemeData); this.TitleFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TitleFontSize", schemeData), CultureInfo.InvariantCulture); this.TitleForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TitleForeColor", schemeData)); this.TitleHeight = new Unit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TitleHeight", schemeData), CultureInfo.InvariantCulture); this.DayBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayBackColor", schemeData)); this.DayFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("DayFont", schemeData); this.DayFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayFontSize", schemeData), CultureInfo.InvariantCulture); this.DayForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayForeColor", schemeData)); this.DayWidth = new Unit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayWidth", schemeData), CultureInfo.InvariantCulture); this.DayHeaderBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayHeaderBackColor", schemeData)); this.DayHeaderFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("DayHeaderFont", schemeData); this.DayHeaderFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayHeaderFontSize", schemeData), CultureInfo.InvariantCulture); this.DayHeaderForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayHeaderForeColor", schemeData)); this.DayHeaderHeight = new Unit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("DayHeaderHeight", schemeData), CultureInfo.InvariantCulture); this.TodayDayBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TodayDayBackColor", schemeData)); this.TodayDayFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("TodayDayFont", schemeData); this.TodayDayFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TodayDayFontSize", schemeData), CultureInfo.InvariantCulture); this.TodayDayForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("TodayDayForeColor", schemeData)); this.SelectedDayBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("SelectedDayBackColor", schemeData)); this.SelectedDayFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("SelectedDayFont", schemeData); this.SelectedDayFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("SelectedDayFontSize", schemeData), CultureInfo.InvariantCulture); this.SelectedDayForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("SelectedDayForeColor", schemeData)); this.OtherMonthDayBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("OtherMonthDayBackColor", schemeData)); this.OtherMonthDayFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("OtherMonthDayFont", schemeData); this.OtherMonthDayFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("OtherMonthDayFontSize", schemeData), CultureInfo.InvariantCulture); this.OtherMonthDayForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("OtherMonthDayForeColor", schemeData)); this.WeekendDayBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("WeekendDayBackColor", schemeData)); this.WeekendDayFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("WeekendDayFont", schemeData); this.WeekendDayFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("WeekendDayFontSize", schemeData), CultureInfo.InvariantCulture); this.WeekendDayForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("WeekendDayForeColor", schemeData)); this.SelectorBackColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("SelectorBackColor", schemeData)); this.SelectorFont = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetIntProperty("SelectorFont", schemeData); this.SelectorFontName = BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("SelectorFontName", schemeData); this.SelectorFontSize = new FontUnit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("SelectorFontSize", schemeData), CultureInfo.InvariantCulture); this.SelectorForeColor = ColorTranslator.FromHtml(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("SelectorForeColor", schemeData)); this.SelectorWidth = new Unit(BaseAutoFormat <System.Web.UI.WebControls.Calendar> .GetStringProperty("SelectorWidth", schemeData), CultureInfo.InvariantCulture); } }
protected internal override void Render(HtmlTextWriter writer) { if (this.Page != null) { this.Page.VerifyRenderingInServerForm(this); } this._borderColor = this.BorderColor; this._borderStyle = this.BorderStyle; this._borderWidth = this.BorderWidth; if (base.ControlStyleCreated) { this.BorderColor = Color.Empty; this.BorderStyle = System.Web.UI.WebControls.BorderStyle.NotSet; this.BorderWidth = Unit.Empty; } base.Render(writer); if (base.ControlStyleCreated) { this.BorderColor = this._borderColor; this.BorderStyle = this._borderStyle; this.BorderWidth = this._borderWidth; } }
public static void InitGeneralTableLayout(System.Web.UI.WebControls.TableItemStyle TableItemStyle, System.Drawing.Color ForeColor, System.Drawing.Color BackColor, System.Drawing.Color BorderColor, System.Web.UI.WebControls.BorderStyle BorderStyle, System.Web.UI.WebControls.Unit BorderWidth, string MyCsClass, System.Web.UI.WebControls.HorizontalAlign HorizontalAlign, System.Web.UI.WebControls.VerticalAlign VerticalAlign, System.Web.UI.WebControls.Unit Width, System.Web.UI.WebControls.Unit Height) { TableItemStyle.BackColor = BackColor; TableItemStyle.BorderColor = BorderColor; TableItemStyle.BorderStyle = BorderStyle; TableItemStyle.BorderWidth = BorderWidth; TableItemStyle.CssClass = MyCsClass; TableItemStyle.HorizontalAlign = HorizontalAlign; TableItemStyle.VerticalAlign = VerticalAlign; TableItemStyle.ForeColor = ForeColor; TableItemStyle.Width = Width; TableItemStyle.Height = Height; }
private string zGetStyleString(web.BorderStyle borderStyle, Color color) { return(String.Format("border-style:{0};border-color:{1};border-width:2px;", Enum.GetName(typeof(web.BorderStyle), borderStyle).ToLower(), color.Name.ToLower())); }