/// <summary>
        /// Must create and return the control 
        /// that will show the logon interface.
        /// If none is available returns null
        /// </summary>
        public Control GetLoginInterface(Style controlStyle)
        {
            this._uIdTable = new Table();
            TableCell cell = new TableCell();
            TableRow row = new TableRow();
            Button child = new Button();
            child.Click += new EventHandler(this.OnUIdSubmit);

            this._uIdTextBox = new TextBox();
            this._uIdTextBox.CssClass = "lddl";
            //this._uIdTable.ControlStyle.Font.CopyFrom(controlStyle.Font);
            this._uIdTable.ControlStyle.CssClass = "tablelddl ";
            this._uIdTable.Width = Unit.Percentage(100.0);
            child.Text = ResourceManager.GetString("SubmitUId");
            child.CssClass = "btn btn-primary btn-xs bw";

            cell.Controls.Add(new LiteralControl(ResourceManager.GetString("EnterUIdMessage", this.LanguageCode)));
            row.Cells.Add(cell);
            this._uIdTable.Rows.Add(row);
            cell = new TableCell();
            row = new TableRow();
            cell.Controls.Add(this._uIdTextBox);
            cell.Controls.Add(child);
            row.Cells.Add(cell);
            this._uIdTable.Rows.Add(row);
            return this._uIdTable;
        }
Пример #2
0
		// What is baseControl for ?
		public void RenderRepeater (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
		{
			PrintValues (user);
			RepeatLayout layout = RepeatLayout;
			bool listLayout = layout == RepeatLayout.OrderedList || layout == RepeatLayout.UnorderedList;

			if (listLayout) {
				if (user != null) {
					if ((user.HasHeader || user.HasFooter || user.HasSeparators))
						throw new InvalidOperationException ("The UnorderedList and OrderedList layouts do not support headers, footers or separators.");
				}

				if (OuterTableImplied)
					throw new InvalidOperationException ("The UnorderedList and OrderedList layouts do not support implied outer tables.");

				int cols = RepeatColumns;
				if (cols > 1)
					throw new InvalidOperationException ("The UnorderedList and OrderedList layouts do not support multi-column layouts.");
			}
			if (RepeatDirection == RepeatDirection.Vertical) {
				if (listLayout)
					RenderList (w, user, controlStyle, baseControl);
				else
					RenderVert (w, user, controlStyle, baseControl);
			} else {
				if (listLayout)
						throw new InvalidOperationException ("The UnorderedList and OrderedList layouts only support vertical layout.");
				RenderHoriz (w, user, controlStyle, baseControl);
			}
		}
Пример #3
0
		public NamedCssStyleCollection Add (Style style)
		{
			if (style != null)
				CopyFrom (style.GetStyleAttributes (null));

			return this;
		}
Пример #4
0
			protected override Style CreateControlStyle ()
			{
				Style s = new Style (new StateBag ());
				s.BackColor = Color.Red;
				s.BorderColor = Color.Red;
				return s;
			}
 protected override ITemplateEditingFrame CreateTemplateEditingFrame(TemplateEditingVerb verb)
 {
     ITemplateEditingService service = (ITemplateEditingService) this.GetService(typeof(ITemplateEditingService));
     DataGrid viewControl = (DataGrid) base.ViewControl;
     Style[] templateStyles = new Style[] { viewControl.ItemStyle, viewControl.EditItemStyle, viewControl.HeaderStyle, viewControl.FooterStyle };
     return service.CreateFrame(this, verb.Text, ColumnTemplateNames, viewControl.ControlStyle, templateStyles);
 }
 protected virtual Style CreateEditorPartChromeStyle(EditorPart editorPart, PartChromeType chromeType)
 {
     if (editorPart == null)
     {
         throw new ArgumentNullException("editorPart");
     }
     if ((chromeType < PartChromeType.Default) || (chromeType > PartChromeType.BorderOnly))
     {
         throw new ArgumentOutOfRangeException("chromeType");
     }
     if ((chromeType == PartChromeType.BorderOnly) || (chromeType == PartChromeType.TitleAndBorder))
     {
         return this.Zone.PartChromeStyle;
     }
     if (this._chromeStyleNoBorder == null)
     {
         Style style = new Style();
         style.CopyFrom(this.Zone.PartChromeStyle);
         if (style.BorderStyle != BorderStyle.None)
         {
             style.BorderStyle = BorderStyle.None;
         }
         if (style.BorderWidth != Unit.Empty)
         {
             style.BorderWidth = Unit.Empty;
         }
         if (style.BorderColor != Color.Empty)
         {
             style.BorderColor = Color.Empty;
         }
         this._chromeStyleNoBorder = style;
     }
     return this._chromeStyleNoBorder;
 }
 public override void CopyFrom(Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         base.CopyFrom(s);
         if (s is DataGridPagerStyle)
         {
             DataGridPagerStyle style = (DataGridPagerStyle) s;
             if (style.IsSet(0x80000))
             {
                 this.Mode = style.Mode;
             }
             if (style.IsSet(0x100000))
             {
                 this.NextPageText = style.NextPageText;
             }
             if (style.IsSet(0x200000))
             {
                 this.PrevPageText = style.PrevPageText;
             }
             if (style.IsSet(0x400000))
             {
                 this.PageButtonCount = style.PageButtonCount;
             }
             if (style.IsSet(0x800000))
             {
                 this.Position = style.Position;
             }
             if (style.IsSet(0x1000000))
             {
                 this.Visible = style.Visible;
             }
         }
     }
 }
 public override void CopyFrom(Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         base.CopyFrom(s);
         if (s is TableItemStyle)
         {
             TableItemStyle style = (TableItemStyle) s;
             if (s.RegisteredCssClass.Length != 0)
             {
                 if (style.IsSet(0x40000))
                 {
                     base.ViewState.Remove("Wrap");
                     base.ClearBit(0x40000);
                 }
             }
             else if (style.IsSet(0x40000))
             {
                 this.Wrap = style.Wrap;
             }
             if (style.IsSet(0x10000))
             {
                 this.HorizontalAlign = style.HorizontalAlign;
             }
             if (style.IsSet(0x20000))
             {
                 this.VerticalAlign = style.VerticalAlign;
             }
         }
     }
 }
 public override void CopyFrom(Style s)
 {
     if (s != null)
     {
         base.CopyFrom(s);
         SubMenuStyle style = s as SubMenuStyle;
         if ((style != null) && !style.IsEmpty)
         {
             if (s.RegisteredCssClass.Length != 0)
             {
                 if (style.IsSet(0x10000))
                 {
                     base.ViewState.Remove("VerticalPadding");
                     base.ClearBit(0x10000);
                 }
                 if (style.IsSet(0x20000))
                 {
                     base.ViewState.Remove("HorizontalPadding");
                     base.ClearBit(0x20000);
                 }
             }
             else
             {
                 if (style.IsSet(0x10000))
                 {
                     this.VerticalPadding = style.VerticalPadding;
                 }
                 if (style.IsSet(0x20000))
                 {
                     this.HorizontalPadding = style.HorizontalPadding;
                 }
             }
         }
     }
 }
Пример #10
0
        /// <devdoc>
        ///    Copies non-blank elements from the specified style, overwriting existing
        ///    style elements if necessary.
        /// </devdoc>
        public override void CopyFrom(Style s) {
            if (s != null) {
                base.CopyFrom(s);

                SubMenuStyle sms = s as SubMenuStyle;
                if (sms != null && !sms.IsEmpty) {
                    // Only copy the paddings if they aren't in the source Style's registered CSS class
                    if (s.RegisteredCssClass.Length != 0) {
                        if (sms.IsSet(PROP_VPADDING)) {
                            ViewState.Remove("VerticalPadding");
                            ClearBit(PROP_VPADDING);
                        }

                        if (sms.IsSet(PROP_HPADDING)) {
                            ViewState.Remove("HorizontalPadding");
                            ClearBit(PROP_HPADDING);
                        }
                    }
                    else {
                        if (sms.IsSet(PROP_VPADDING)) {
                            this.VerticalPadding = sms.VerticalPadding;
                        }

                        if (sms.IsSet(PROP_HPADDING)) {
                            this.HorizontalPadding = sms.HorizontalPadding;
                        }
                    }
                }
            }
        }
Пример #11
0
 //***************************************************************************
 // Class Constructors
 // 
 public DynamicMenuPopoutGroup(DynamicMenuItemCollection items, Style itemStyle, Style activeStyle, Style hoverStyle)
     : base(null, itemStyle, activeStyle, hoverStyle)
 {
     this._assocDivs = new Collections.StringCollection();
     this._menuItems = items;
     //this._menuItems.Updated += new Collections.CollectionEventHandler(menuItems_Updated);
 }
 /// <summary>
 /// Must create and return the control 
 /// that will show the administration interface
 /// If none is available returns null
 /// </summary>
 public Control GetAdministrationInterface(Style controlStyle)
 {
     this._adminTable = new Table();
     this._adminTable.ControlStyle.CopyFrom(controlStyle);
     this._adminTable.Width = Unit.Percentage(100);
     TableCell cell = new TableCell();
     TableRow row = new TableRow();
     cell.ColumnSpan = 2;
     cell.Text = ResourceManager.GetString("NSurveySecurityAddinDescription", this.LanguageCode);
     row.Cells.Add(cell);
     this._adminTable.Rows.Add(row);
     cell = new TableCell();
     row = new TableRow();
     CheckBox child = new CheckBox();
     child.Checked = new Surveys().NSurveyAllowsMultipleSubmissions(this.SurveyId);
     Label label = new Label();
     label.ControlStyle.Font.Bold = true;
     label.Text = ResourceManager.GetString("MultipleSubmissionsLabel", this.LanguageCode);
     cell.Width = Unit.Percentage(50);
     cell.Controls.Add(label);
     row.Cells.Add(cell);
     cell = new TableCell();
     child.CheckedChanged += new EventHandler(this.OnCheckBoxChange);
     child.AutoPostBack = true;
     cell.Controls.Add(child);
     Unit.Percentage(50);
     row.Cells.Add(cell);
     this._adminTable.Rows.Add(row);
     return this._adminTable;
 }
 /// <summary>
 /// Build a row with the given control and style
 /// </summary>
 /// <param name="child"></param>
 /// <param name="rowStyle"></param>
 /// <param name="labelText"></param>
 /// <returns></returns>
 protected TableRow BuildRow(Control child, string labelText, Style rowStyle)
 {
     TableRow row = new TableRow();
     TableCell cell = new TableCell();
     if (labelText != null)
     {
         Label label = new Label();
         label.ControlStyle.Font.Bold = true;
         label.Text = labelText;
         cell.Controls.Add(label);
         cell.Wrap = false;
         if (child == null) cell.ColumnSpan = 2;
         cell.VerticalAlign = VerticalAlign.Top;
         row.Cells.Add(cell);
  
         cell = new TableCell();
     }
     else
     {
         cell.ColumnSpan = 2;
     }
     if (child != null)
     {
         cell.Controls.Add(child);
     }
     row.Cells.Add(cell);
     row.ControlStyle.CopyFrom(rowStyle); //CSS .addinsLayout
     return row;
 }
 public StyleBlockStyles AddStyles(Style style)
 {
     if (style != null)
     {
         this.AddStyles(style.GetStyleAttributes(this._styleControl));
     }
     return this;
 }
Пример #15
0
 //BoundControl_DataBound方法利用HasParentControlCalledDataBinding检查是否已经创建了Builder,
 //如果是,则不再执行寻找适当Builder的操作。Adapters表的初始化在构造函数中完成:
 public CommonPager()
 {
     SelectedPager = new System.Web.UI.WebControls.Style();
     UnselectedPager = new System.Web.UI.WebControls.Style();
     _adapters = new AdapterCollection();
     _adapters.Add(typeof(DataTable), new DataTableAdapterBuilder());
     _adapters.Add(typeof(DataView), new DataViewAdapterBuilder());
 }
Пример #16
0
			protected override Style GetItemStyle (ListItemType itemType, int repeatIndex)
			{
				Style s = new Style ();
				s.BackColor = Color.Red;
				s.BorderStyle = BorderStyle.Solid;
				WebTest.CurrentTest.UserData = "GetItemStyle";
				return s;
			}
 private void CopyStyle(Style toStyle, Style fromStyle)
 {
     if ((fromStyle != null) && fromStyle.IsSet(0x2000))
     {
         toStyle.Font.Underline = fromStyle.Font.Underline;
     }
     toStyle.CopyFrom(fromStyle);
 }
Пример #18
0
 internal TemplateEditingFrame(string frameName, string[] templateNames, Style controlStyle, Style[] templateStyles)
 {
     this._name = frameName;
     this._templateNames = templateNames;
     this._controlStyle = controlStyle;
     this._templateStyles = templateStyles;
     this._changeTable = new HybridDictionary(false);
 }
Пример #19
0
 public BaseMenu(string clientId, bool isRightToLeft, Action<HtmlTextWriter, MenuItem, int> renderDynamicItem, SubMenuStyle dynamicMenuStyle, Style dynamicMenuItemStyle, Style dynamicHoverStyle)
 {
     IsRightToLeft = isRightToLeft;
     this.renderDynamicItem = renderDynamicItem;
     DynamicMenuItemStyle = dynamicMenuItemStyle;
     DynamicHoverStyle = dynamicHoverStyle;
     DynamicMenuStyle = dynamicMenuStyle;
     ClientID = clientId;
 }
Пример #20
0
		// What is baseControl for ?
		public void RenderRepeater (HtmlTextWriter w, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
		{
			PrintValues (user);

			if (RepeatDirection == RepeatDirection.Vertical)
				RenderVert (w, user, controlStyle, baseControl);
			else
				RenderHoriz (w, user, controlStyle, baseControl);
		}
 private void RegisterStyle(Style style)
 {
     if ((style != null) && !style.IsEmpty)
     {
         string cssClass = this._menuUser.ClientID + "__Menu_" + this._cssStyleIndex++.ToString(NumberFormatInfo.InvariantInfo);
         this._menuUser.Page.Header.StyleSheet.CreateStyleRule(style, this._menuUser.UrlResolver, "." + cssClass);
         style.SetRegisteredCssClass(cssClass);
     }
 }
Пример #22
0
		public void ShouldSerializeNames ()
		{
			Style style = new Style ();
			FontInfo fontInfo = style.Font;
			Assert.IsFalse (fontInfo.ShouldSerializeNames ());
			fontInfo.Name = "Verdana";
			Assert.IsTrue (fontInfo.ShouldSerializeNames ());
			fontInfo.Name = String.Empty;
			Assert.IsFalse (fontInfo.ShouldSerializeNames ());
		}
Пример #23
0
		public void Style_Copy ()
		{
			Style s = new Style ();
			Style copy = new Style ();

			SetSomeValues(s);

			copy.CopyFrom (s);
			Assert.AreEqual (s.BackColor, Color.Red, "Copy1");
		}
Пример #24
0
 public RenderCalendarCellArgs(HtmlTextWriter writer, Style cellStyle, CalendarDay dayInfo, string eventArgument, string text, string title)
     : base(false)
 {
     Writer = writer;
     CellStyle = cellStyle;
     Text = text;
     Title = title;
     DayInfo = dayInfo;
     EventArgument = eventArgument;
 }
Пример #25
0
        // TODO: Add a tab index to this control
//		private short tabIndex;

        /// <summary>
        /// The default constructor.
        /// </summary>
        public DateEditor()
        {
            _months    = new string[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
            _format    = "MONTH;/;DAY;/;YEAR;-;HOUR;:;MINUTE";
            _minYear   = DateTime.Now.Year - 100;
            _maxYear   = DateTime.Now.Year + 3;
            _dateStyle = new System.Web.UI.WebControls.Style();
            _timeStyle = new System.Web.UI.WebControls.Style();
            _baseStyle = new System.Web.UI.WebControls.Style();
            _alertText = "The date you selected is not valid and has been reset to the last day in the month.";
        }
        /// <summary>
        /// Displaying set shows in Green.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void CalendarShowDate_DayRender(object sender, DayRenderEventArgs e)
        {
            bool tentativeshowDate = false;

            // Display Show Scheduled.
            Style ShowExists = new Style();
            ShowExists.BackColor = System.Drawing.Color.Green;
            ShowExists.BorderColor = System.Drawing.Color.White;
            ShowExists.BorderWidth = 3;

            //establish an connection to the SQL server
            SqlConnection connection = new SqlConnection();
            connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ToConnectionString"].ConnectionString;
            string selectCommand = "SELECT Distinct ScheduleDate, TentativeShow " +
                                    "FROM PerformersAvailable " +
                                    "WHERE PerformersAvailable. TentativeShow = 1";
            SqlCommand command = new SqlCommand(selectCommand, connection);
            connection.Open();
            SqlDataReader reader = null;
            try
            {
                reader = command.ExecuteReader();
                while (reader.Read())
                {
                    DateTime dateTime = (DateTime)reader["ScheduleDate"];
                    byte value2 = (byte)reader["TentativeShow"];

                    if (value2 == 1)
                    {
                        tentativeshowDate = true;
                    }

                    // do this somehow
                    if ((e.Day.Date >= new DateTime(dateTime.Year, dateTime.Month, dateTime.Day)) &&
                        (e.Day.Date <= new DateTime(dateTime.Year, dateTime.Month, dateTime.Day)))
                    {
                        if (tentativeshowDate)
                        {
                            e.Cell.ApplyStyle(ShowExists);
                        }

                    }
                }
            }
            catch (Exception ex)
            {
                //LabelError.Text = "Caught Exception " + ex.ToString();
            }
            finally
            {
                reader.Close();
                connection.Close();
            }
        }
        private void BuildAddInList()
        {
            WebSecurityAddInCollection _securityAddIns;
            Control adminControl;
            Table addInContainer = new Table();
            addInContainer.Width = Unit.Percentage(100);
            Table addInTable = new Table();
            // moved to css files:
            //			addInTable.CellSpacing = 2;
            //			addInTable.CellPadding = 4;
            addInTable.CssClass = "questionBuilder";
            Style controlStyle = new Style();
            controlStyle.CssClass = "addinsLayout";
            _securityAddIns = WebSecurityAddInFactory.CreateWebSecurityAddInCollection(new SecurityAddIns().GetWebSecurityAddIns(SurveyId), ViewState, null);

            if (_securityAddIns.Count == 0)
            {
                SecurityOptionsPlaceHolder.Visible = false;
                // No Addins
                addInTable.Rows.Add(BuildAddInOptionsRow(null, _securityAddIns.Count));
            }
            else
            {
                SecurityOptionsPlaceHolder.Visible = true;
                for (int i = 0; i < _securityAddIns.Count; i++)
                {
                    addInTable.Rows.Add(BuildAddInOptionsRow(_securityAddIns[i], _securityAddIns.Count));
                    adminControl = _securityAddIns[i].GetAdministrationInterface(controlStyle);
                    if (adminControl != null)
                    {
                        addInTable.Rows.Add(BuildRow(adminControl));
                    }
                    else
                    {
                        addInTable.Rows.Add(BuildRow(new LiteralControl(((PageBase)Page).GetPageResource("AddInAdminNotAvailableMessage"))));
                    }
                    addInContainer.Rows.Add(BuildRow(addInTable));

                    AddInListPlaceHolder.Controls.Add(addInContainer);

                    // Creates a new page
                    addInContainer = new Table();
                    addInContainer.Width = Unit.Percentage(100);
                    addInTable = new Table();
                    // moved to css file
                    //					addInTable.CellSpacing = 2;
                    //					addInTable.CellPadding = 4;
                    addInTable.CssClass = "questionBuilder";
                }
            }

            addInContainer.Rows.Add(BuildRow(addInTable));
            AddInListPlaceHolder.Controls.Add(addInContainer);
        }
Пример #28
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public TreeNode()
 {
     ID                   = GetNewID();
     _icon                = string.Empty;
     _link                = string.Empty;
     _text                = string.Empty;
     _key                 = string.Empty;
     _target              = string.Empty;
     _nodeStyle           = new System.Web.UI.WebControls.Style();
     _nodeStyle.Font.Size = FontUnit.XSmall;
 }
Пример #29
0
 public override void CopyFrom(System.Web.UI.WebControls.Style s)
 {
     this.BackColor   = s.BackColor;
     this.BorderColor = s.BorderColor;
     this.BorderStyle = s.BorderStyle;
     this.BorderWidth = s.BorderWidth;
     this.CssClass    = s.CssClass;
     this.Font.CopyFrom(s.Font);
     this.ForeColor = s.ForeColor;
     this.Height    = s.Height;
     this.Width     = s.Width;
 }
 protected override void AddAttributesToRender(HtmlTextWriter writer)
 {
     string cssClass = this.CssClass;
     Style style = this._style;
     this.CssClass = string.Empty;
     this._style = null;
     base.ControlStyle.Reset();
     base.AddAttributesToRender(writer);
     this.CssClass = cssClass;
     this._style = style;
     this.RenderStyleAttributes(writer);
 }
 /// <summary>
 /// Build a row with the given control and style
 /// </summary>
 /// <param name="child"></param>
 /// <param name="rowStyle"></param>
 /// <returns></returns>
 protected TableRow BuildRow(Control child, Style rowStyle)
 {
     TableRow row = new TableRow();
     TableCell cell = new TableCell();
     if (child != null)
     {
         cell.Controls.Add(child);
     }
     row.Cells.Add(cell);
     row.ControlStyle.CopyFrom(rowStyle);
     return row;
 }
Пример #32
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // if (!this.IsPostBack)
            // {
            ConMysql();

            refreshTable("");

            //  }
            style1        = new System.Web.UI.WebControls.Style();
            style1.Height = 30;
        }
Пример #33
0
        /// <summary>
        /// This method create a selector based on the parameters.
        /// </summary>
        /// <param name="output">The HtmlTextWriter to write.</param>
        /// <param name="suffix">The suffix to use to identify the selector with the LoadPostData method.</param>
        /// <param name="style">The style class to use.</param>
        /// <param name="onchange">The value of the OnChange attribute of the selector to use with the client side validator.</param>
        /// <param name="min">The minimum value of the selector.</param>
        /// <param name="max">The maximum value of the selector.</param>
        /// <param name="padding">The number of chars to use with padding.</param>
        /// <param name="selectedValue">The selected value.</param>
        private void WriteSelector(HtmlTextWriter output, string suffix, System.Web.UI.WebControls.Style style, string onchange, int min, int max, int padding, int selectedValue)
        {
            // Some variable we will use
            int index;

            // Check if the actual year value can be displayed in the selector
            if (selectedValue < min || selectedValue > max)
            {
                throw new Exception("The year value (" + Date.Year.ToString() + ") of the Date property is greater than the maximum (" + max.ToString() + ") or less than the minimum (" + min.ToString() + "). Please adjust values or set AutoAdjust property to true.");
            }

            // Write the selector
            output.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID + suffix);

            // Render the validation action code only if needed
            if (_renderUplevel && onchange != null)
            {
                output.AddAttribute(HtmlTextWriterAttribute.Onchange, onchange);
            }

            // Add the styles to the selector after the merge with the base style.
            style.MergeWith(_baseStyle);
            style.AddAttributesToRender(output);

            output.RenderBeginTag(HtmlTextWriterTag.Select);

            // Write the option tags
            for (index = min; index <= max; index++)
            {
                output.AddAttribute(HtmlTextWriterAttribute.Value, index.ToString());

                // Set the selected value
                if (index == selectedValue)
                {
                    output.AddAttribute(HtmlTextWriterAttribute.Selected, null);
                }

                output.RenderBeginTag(HtmlTextWriterTag.Option);
                if (suffix == "_month" && !_monthNamesDisabled)
                {
                    output.InnerWriter.Write(_months[index - 1]);
                }
                else
                {
                    output.InnerWriter.Write(index.ToString().PadLeft(padding, '0'));
                }
                output.RenderEndTag();
            }

            // Write the selector end tag
            output.RenderEndTag();
        }
 public override void CopyFrom(Style s)
 {
     if ((s != null) && !s.IsEmpty)
     {
         base.CopyFrom(s);
         if (s is PanelStyle)
         {
             PanelStyle style = (PanelStyle) s;
             if (s.RegisteredCssClass.Length != 0)
             {
                 if (style.IsSet(0x10000))
                 {
                     base.ViewState.Remove("BackImageUrl");
                     base.ClearBit(0x10000);
                 }
                 if (style.IsSet(0x80000))
                 {
                     base.ViewState.Remove("ScrollBars");
                     base.ClearBit(0x80000);
                 }
                 if (style.IsSet(0x100000))
                 {
                     base.ViewState.Remove("Wrap");
                     base.ClearBit(0x100000);
                 }
             }
             else
             {
                 if (style.IsSet(0x10000))
                 {
                     this.BackImageUrl = style.BackImageUrl;
                 }
                 if (style.IsSet(0x80000))
                 {
                     this.ScrollBars = style.ScrollBars;
                 }
                 if (style.IsSet(0x100000))
                 {
                     this.Wrap = style.Wrap;
                 }
             }
             if (style.IsSet(0x20000))
             {
                 this.Direction = style.Direction;
             }
             if (style.IsSet(0x40000))
             {
                 this.HorizontalAlign = style.HorizontalAlign;
             }
         }
     }
 }
Пример #35
0
		public NamedCssStyleCollection RegisterStyle (Style style, string name = null)
		{
			if (style == null)
				throw new ArgumentNullException ("style");
			
			if (name == null)
				name = String.Empty;

			NamedCssStyleCollection cssStyle = GetStyle (name);
			cssStyle.CopyFrom (style.GetStyleAttributes (null));

			return cssStyle;
		}
Пример #36
0
 /// <summary>
 /// Initalize a <see cref="NodeDesign"/> objet.
 /// </summary>
 /// <param name="key">Unique key identifies the node.</param>
 /// <param name="parentKey">Parent key to identify the parent node.</param>
 /// <param name="text">Text of the current node.</param>
 /// <param name="link">Link of the current node.</param>
 /// <param name="target">Target frame of the link.</param>
 private void _Init(string key, string parentKey, string text, string link, string target)
 {
     _key                 = key;
     _parentKey           = parentKey;
     _text                = text;
     _link                = link;
     _selected            = false;
     _expanded            = false;
     _nodeStyle           = new System.Web.UI.WebControls.Style();
     _nodeStyle.Font.Size = FontUnit.XSmall;
     _target              = target;
     _icon                = "";
 }
 private ASP.Style GetStyle()
 {
     ASP.Style style = new ASP.Style();
     style.BackColor   = this.BackColor;
     style.BorderColor = this.BorderColor;
     style.BorderStyle = this.BorderStyle;
     style.BorderWidth = this.BorderWidth;
     style.CssClass    = this.CssClass;
     style.Font.CopyFrom(this.Font);
     style.ForeColor = this.ForeColor;
     style.Height    = this.Height;
     style.Width     = this.Width;
     return(style);
 }
Пример #38
0
 public TemplateDefinition(ControlDesigner designer, string name, object templatedObject, string templatePropertyName, System.Web.UI.WebControls.Style style, bool serverControlsOnly) : base(designer, name)
 {
     if ((templatePropertyName == null) || (templatePropertyName.Length == 0))
     {
         throw new ArgumentNullException("templatePropertyName");
     }
     if (templatedObject == null)
     {
         throw new ArgumentNullException("templatedObject");
     }
     this._serverControlsOnly = serverControlsOnly;
     this._style                = style;
     this._templatedObject      = templatedObject;
     this._templatePropertyName = templatePropertyName;
 }
Пример #39
0
        internal void ApplyTo(WebCtrlStyle style)
        {
            style.Font.Bold   = ((BooleanOption)this[BoldKey, true]) == BooleanOption.True;
            style.Font.Italic = ((BooleanOption)this[ItalicKey, true]) == BooleanOption.True;
            style.Font.Name   = (String)this[FontNameKey, true];
            style.ForeColor   = (Color)this[ForeColorKey, true];
            style.BackColor   = (Color)this[BackColorKey, true];

            switch ((FontSize)this[FontSizeKey, true])
            {
            case FontSize.Large:
                style.Font.Size = FontUnit.Larger;
                break;

            case FontSize.Small:
                style.Font.Size = FontUnit.Smaller;
                break;

            default:
                break;
            }
        }
Пример #40
0
 private void WriteSelector(HtmlTextWriter output, string suffix, int min, int max, int padding, int selectedValue, System.Web.UI.WebControls.Style selectorStyle, string[] months, bool show)
 {
     WriteSelector(output, suffix, min, max, padding, selectedValue, selectorStyle, months, show, true);
 }
 public override void CopyFrom(Style s)
 {
 }
Пример #42
0
 public void AddCssClass(Style style, string cssClass)
 {
     style.AddCssClass(cssClass);
 }
Пример #43
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            //Put user code to initialize the page here

            System.Web.UI.HtmlControls.HtmlForm frm = (HtmlForm)this.FindControl("Form1");
            GHTTestBegin(frm);

            GHTActiveSubTest = GHTSubTest1;
            try
            {
                DataGrid1.DataSource  = GHTTests.GHDataSources.DSDataTable(1, 3);
                DataGrid1.AllowPaging = true;

                System.Web.UI.WebControls.Style s = new System.Web.UI.WebControls.Style();
                s.Font.Bold = true;
                DataGrid1.PagerStyle.MergeWith(s);
                DataGrid1.DataBind();;
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = GHTSubTest2;
            try
            {
                DataGrid2.DataSource  = GHTTests.GHDataSources.DSDataTable(1, 3);
                DataGrid2.AllowPaging = true;

                DataGrid2.PagerStyle.Mode = PagerMode.NumericPages;

                System.Web.UI.WebControls.Style s = new System.Web.UI.WebControls.Style();
                s.Font.Bold = true;
                //s.Height.Pixel(50);
                //s.Width.Pixel(400);

                DataGrid2.PagerStyle.MergeWith(s);
                DataGrid2.DataBind();;
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTActiveSubTest = GHTSubTest3;
            try
            {
                DataGrid3.DataSource                 = GHTTests.GHDataSources.DSDataTable(1, 3);
                DataGrid3.AllowPaging                = true;
                DataGrid3.PagerStyle.Mode            = PagerMode.NumericPages;
                DataGrid3.PagerStyle.PageButtonCount = 20;
                DataGrid3.PageSize = 2;

                System.Web.UI.WebControls.Style s = new System.Web.UI.WebControls.Style();
                s.Font.Bold = true;
                //s.Height.Pixel(50);
                //s.Width.Pixel(400);

                DataGrid3.PagerStyle.MergeWith(s);
                DataGrid3.DataBind();;
            }
            catch (Exception ex)
            {
                GHTSubTestUnexpectedExceptionCaught(ex);
            }

            GHTTestEnd();
        }
Пример #44
0
 public void RegisterStyle(Style baseStyle, Style linkStyle, HtmlHead head)
 {
     RegisterStyle(baseStyle, linkStyle, null, head);
 }
Пример #45
0
        protected override void CreateChildControls()
        {
            LinkButton lnkPrevMon = new LinkButton();

            lnkPrevMon.ID     = "lnkPrevMon";
            lnkPrevMon.Text   = this.PrevMonthText;
            lnkPrevMon.Click += new EventHandler(this.lnkPrevMon_OnClick);
            this._lnkPrevMon  = lnkPrevMon;

            LinkButton lnkNextMon = new LinkButton();

            lnkNextMon.ID     = "lnkNextMon";
            lnkNextMon.Text   = this.NextMonthText;
            lnkNextMon.Click += new EventHandler(this.lnkNextMon_OnClick);
            this._lnkNextMon  = lnkNextMon;

            Style hdrTextStyle = new System.Web.UI.WebControls.Style();

            hdrTextStyle.MergeWith(this._dayHdrStyle);
            hdrTextStyle.BorderStyle = BorderStyle.None;

            LinkButton lnkHdrSun = new LinkButton();

            lnkHdrSun.ID   = "lnkHdrSun";
            lnkHdrSun.Text = this.GetDayName(DayOfWeek.Sunday);
            lnkHdrSun.ApplyStyle(hdrTextStyle);
            lnkHdrSun.CommandName     = "ShowDay";
            lnkHdrSun.CommandArgument = DayOfWeek.Sunday.ToString();
            lnkHdrSun.Command        += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrSun           = lnkHdrSun;

            LinkButton lnkHdrMon = new LinkButton();

            lnkHdrMon.ID   = "lnkHdrMon";
            lnkHdrMon.Text = this.GetDayName(DayOfWeek.Monday);
            lnkHdrMon.ApplyStyle(hdrTextStyle);
            lnkHdrMon.CommandName     = "ShowDay";
            lnkHdrMon.CommandArgument = DayOfWeek.Monday.ToString();
            lnkHdrMon.Command        += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrMon           = lnkHdrMon;

            LinkButton lnkHdrTue = new LinkButton();

            lnkHdrTue.ID   = "lnkHdrTue";
            lnkHdrTue.Text = this.GetDayName(DayOfWeek.Tuesday);
            lnkHdrTue.ApplyStyle(hdrTextStyle);
            lnkHdrTue.CommandName     = "ShowDay";
            lnkHdrTue.CommandArgument = DayOfWeek.Tuesday.ToString();
            lnkHdrTue.Command        += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrTue           = lnkHdrTue;

            LinkButton lnkHdrWed = new LinkButton();

            lnkHdrWed.ID   = "lnkHdrWed";
            lnkHdrWed.Text = this.GetDayName(DayOfWeek.Wednesday);
            lnkHdrWed.ApplyStyle(hdrTextStyle);
            lnkHdrWed.CommandName     = "ShowDay";
            lnkHdrWed.CommandArgument = DayOfWeek.Wednesday.ToString();
            lnkHdrWed.Command        += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrWed           = lnkHdrWed;

            LinkButton lnkHdrThu = new LinkButton();

            lnkHdrThu.ID   = "lnkHdrThu";
            lnkHdrThu.Text = this.GetDayName(DayOfWeek.Thursday);
            lnkHdrThu.ApplyStyle(hdrTextStyle);
            lnkHdrThu.CommandName     = "ShowDay";
            lnkHdrThu.CommandArgument = DayOfWeek.Thursday.ToString();
            lnkHdrThu.Command        += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrThu           = lnkHdrThu;

            LinkButton lnkHdrFri = new LinkButton();

            lnkHdrFri.ID   = "lnkHdrFri";
            lnkHdrFri.Text = this.GetDayName(DayOfWeek.Friday);
            lnkHdrFri.ApplyStyle(hdrTextStyle);
            lnkHdrFri.CommandName     = "ShowDay";
            lnkHdrFri.CommandArgument = DayOfWeek.Friday.ToString();
            lnkHdrFri.Command        += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrFri           = lnkHdrFri;

            LinkButton lnkHdrSat = new LinkButton();

            lnkHdrSat.ID   = "lnkHdrSat";
            lnkHdrSat.Text = this.GetDayName(DayOfWeek.Saturday);
            lnkHdrSat.ApplyStyle(hdrTextStyle);
            lnkHdrSat.CommandName     = "ShowDay";
            lnkHdrSat.CommandArgument = DayOfWeek.Saturday.ToString();
            lnkHdrSat.Command        += new CommandEventHandler(this.lnkHdr_OnCommand);
            this._lnkHdrSat           = lnkHdrSat;

            // Create all link buttons for the days we're going to display.
            if (this._lnkDates != null)
            {
                this._lnkDates.Clear();
            }
            this._lnkDates = new Collections.WebControlCollection();
            DateTime curWkStart = this.GetCalFirstDay();

            while (curWkStart.Date < this.dtCurMon.AddMonths(1))
            {
                DateTime curDay = curWkStart;
                for (int i = 0; i < 7; i++)
                {
                    LinkButton lnkDate = new LinkButton();
                    lnkDate.ID              = "lnkDate_" + curDay.ToString("yyyyMMdd");
                    lnkDate.Text            = curDay.Day.ToString();
                    lnkDate.CssClass        = "date";
                    lnkDate.CommandName     = "ShowDay";
                    lnkDate.CommandArgument = curDay.ToString("yyyyMMdd");
                    lnkDate.Command        += new CommandEventHandler(this.lnkDate_OnCommand);
                    lnkDate.ApplyStyle((curDay.Month == this.dtCurMon.Month) ? this._curMonDateStyle : this._othMonDateStyle);
                    this._lnkDates.Add(lnkDate, curDay.ToString("yyyMMdd"));

                    curDay = curDay.AddDays(1);
                }
                curWkStart = curDay;
            }

            base.CreateChildControls();

            this.Controls.Add(this._lnkPrevMon);
            this.Controls.Add(this._lnkNextMon);
            this.Controls.Add(this._lnkHdrSun);
            this.Controls.Add(this._lnkHdrMon);
            this.Controls.Add(this._lnkHdrTue);
            this.Controls.Add(this._lnkHdrWed);
            this.Controls.Add(this._lnkHdrThu);
            this.Controls.Add(this._lnkHdrFri);
            this.Controls.Add(this._lnkHdrSat);

            for (int i = 0; i < this._lnkDates.Count; i++)
            {
                this.Controls.Add(this._lnkDates[i]);
            }
        }
Пример #46
0
 public void RegisterStyle(Style baseStyle, HtmlHead head)
 {
     RegisterStyle(baseStyle, (string)null, head);
 }
Пример #47
0
        private void WriteSelector(HtmlTextWriter output, string suffix, int min, int max, int padding, int selectedValue, System.Web.UI.WebControls.Style selectorStyle, string[] months, bool show, bool relative)
        {
            int index;

            selectorStyle.AddAttributesToRender(output);

            if (!show)
            {
                if (relative)
                {
                    output.AddStyleAttribute("position", "relative");
                }
                else
                {
                    output.AddStyleAttribute("position", "absolute");
                }

                output.AddStyleAttribute("visibility", "hidden");
            }
            output.RenderBeginTag(HtmlTextWriterTag.Select);

            for (index = min; index <= max; index++)
            {
                output.AddAttribute(HtmlTextWriterAttribute.Value, index.ToString());

                if (index == selectedValue)
                {
                    output.AddAttribute(HtmlTextWriterAttribute.Selected, null);
                }

                output.RenderBeginTag(HtmlTextWriterTag.Option);
                if (suffix.StartsWith("_month"))
                {
                    output.InnerWriter.Write(months[index - 1]);
                }
                else if (suffix == "_meridiem")
                {
                    output.InnerWriter.Write((index == 0 ? "AM" : "PM"));
                }
                else
                {
                    output.InnerWriter.Write(index.ToString().PadLeft(padding, '0'));
                }
                output.RenderEndTag();
            }

            output.RenderEndTag();
        }
 public override void MergeWith(Style s)
 {
 }
Пример #49
0
 public TemplateDefinition(ControlDesigner designer, string name, object templatedObject, string templatePropertyName, System.Web.UI.WebControls.Style style) : this(designer, name, templatedObject, templatePropertyName, style, false)
 {
 }
Пример #50
0
        /// <summary>
        /// This method create a selector based on the parameters.
        /// </summary>
        /// <param name="output">The HtmlTextWriter to write.</param>
        /// <param name="suffix">The suffix to use to identify the selector with the LoadPostData method.</param>
        /// <param name="style">The style class to use.</param>
        /// <param name="onchange">The value of the OnChange attribute of the selector to use with the client side validator.</param>
        /// <param name="min">The minimum value of the selector.</param>
        /// <param name="max">The maximum value of the selector.</param>
        /// <param name="padding">The number of chars to use with padding.</param>
        /// <param name="selectedValue">The selected value.</param>
        private void WriteSelector(HtmlTextWriter output, string suffix, System.Web.UI.WebControls.Style style, string onchange, int min, int max, int padding, int selectedValue, short tabIndex)
        {
            // Check if the actual year value can be displayed in the selector
            if (selectedValue < min || selectedValue > max)
            {
                throw new Exception("The year value (" + Date.Year.ToString() + ") of the Date property is greater than the maximum (" + max.ToString() + ") or less than the minimum (" + min.ToString() + "). Please adjust values or set AutoAdjust property to true.");
            }

            // Some variable we will use
            int index;

            output.WriteBeginTag("select");
            if (!this.Enabled)
            {
                output.WriteAttribute("disabled", "disabled");
            }
            output.WriteAttribute("name", UniqueID + suffix);
            if (_renderUplevel && onchange != null)
            {
                output.WriteAttribute("onchange", onchange);
            }
            output.WriteLine(HtmlTextWriter.TagRightChar);

            // Add the styles to the selector after the merge with the base style.
            style.MergeWith(_baseStyle);
            style.AddAttributesToRender(output);

//			// Write Tab Index
//			if(tabIndex != 0)
//				output.AddAttribute("tabindex", tabIndex.ToString());

            output.Indent++;
            // Write the option tags
            for (index = min; index <= max; index++)
            {
                output.WriteBeginTag("option");
                output.WriteAttribute("value", index.ToString());

                // Set the selected value
                if (index == selectedValue)
                {
                    output.WriteAttribute("selected", null);
                }

                output.Write(HtmlTextWriter.TagRightChar);

                if (suffix == "_month" && !_monthNamesDisabled)
                {
                    output.Write(_months[index - 1]);
                }
                else
                {
                    output.Write(index.ToString().PadLeft(padding, '0'));
                }
                output.WriteEndTag("option");
                output.WriteLine();
            }
            output.Indent--;

            // Write the selector end tag
            output.WriteEndTag("select");
        }
 public void RenderRepeater(System.Web.UI.HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl)
 {
 }