Inheritance: System.Web.UI.Page
Example #1
0
 public string GetControlsHTML(Control c)
 {
     System.IO.StringWriter sw = new System.IO.StringWriter();
     HtmlTextWriter hw = new HtmlTextWriter(sw);
     c.RenderControl(hw);
     return sw.ToString();
 }
        public void InstantiateIn(Control container)
        {

            PlaceHolder templatePlaceHolder = new PlaceHolder();
            container.Controls.Add(templatePlaceHolder);
            templatePlaceHolder.DataBinding += new EventHandler(DataBindTemplate);
        }
Example #3
0
 public ExpandableScroll(Control owner, int page, int x, int y, int height)
     : base(0, 0)
 {
     m_owner = owner;
     Position = new Point(x, y);
     m_expandableScrollHeight = height;
 }
Example #4
0
    //-------------------------------------------------------------------------------------------
    public void DeleteCheckedItems(SqlTransaction transaction, Control parent)
    {
        //foreach (Control control in parent.Controls)
          //{
          //     if (control.GetType() == typeof(CheckBox))
          //     {
          //          CheckBox item = (CheckBox)control;
          //          if (item.Checked)
          //          {
          //               Guid itemId = new Guid(item.Attributes["datakey"]);
          //               DataRowLookup reverseLookup = DatabaseHelper.Session.Get<DataRowLookup>(itemId);
          //               if (reverseLookup != null)
          //               {
          //                    SqlCommand command = new SqlCommand("delete from " + reverseLookup.TableName + " where [email protected]", wvvrdb.MSSQLDB);
          //                    command.Parameters.AddWithValue("Id", reverseLookup.RowId);
          //                    command.Transaction = transaction;
          //                    command.ExecuteNonQuery();
          //               }

          //               string sql = "delete from system_datalinks where ([email protected] and [email protected]) ";
          //               sql += "or ([email protected] and [email protected])";
          //               SqlCommand dataLinks = new SqlCommand(sql, wvvrdb.MSSQLDB);
          //               dataLinks.Parameters.AddWithValue("Object1", itemId);
          //               dataLinks.Parameters.AddWithValue("Object2", new Guid(Request["id"]));
          //               dataLinks.Transaction = transaction;
          //               dataLinks.ExecuteNonQuery();
          //          }
          //     }
          //     if (control.HasControls())
          //     {
          //          DeleteCheckedItems(transaction, control);
          //     }
          //}
    }
Example #5
0
        public TreeNode(Control control)
        {
            Control = control;
            Type = control.GetType().Name;

            var classesChanged = Observable.FromEventPattern<
                    NotifyCollectionChangedEventHandler, 
                    NotifyCollectionChangedEventArgs>(
                x => control.Classes.CollectionChanged += x,
                x => control.Classes.CollectionChanged -= x);

            classesChanged.Select(_ => Unit.Default)
                .StartWith(Unit.Default)
                .Subscribe(_ =>
                {
                    if (control.Classes.Count > 0)
                    {
                        Classes = "(" + string.Join(" ", control.Classes) + ")";
                    }
                    else
                    {
                        Classes = string.Empty;
                    }
                });
        }
    public static void SuspendDrawing(Control c)
    {
        if (c == null)
            throw new ArgumentNullException("c");

        WindowsApiMethods.SendMessage(c.Handle, (Int32)WM_SETREDRAW, (Int32)0, (Int32)0);
    }
Example #7
0
        public MainWindow()
        {
            InitializeComponent();
            stackControls.Visibility = Visibility.Hidden;

            Control = new Control();
        }
 //Overwrite InstantiateIn() method of ITemplate interface.
 public void InstantiateIn(Control container)
 {
     if (Page == 1)
     {
         //Code to create the ItemTemplate and its field.
         if (myListItemType == ListItemType.Item)
         {
             Label lbl = new Label();
             lbl.ID = "LblAttendanceType" + subjectID + subscript;
             lbl.Text = text;
             container.Controls.Add(lbl);
         }
     }
     else
     {
         //Code to create the ItemTemplate and its field.
         if (myListItemType == ListItemType.Item)
         {
             Label lbl = new Label();
             lbl.ID = "LblAttendanceType" + date + lectureID;
             lbl.Text = "fedfesgdsg";
             container.Controls.Add(lbl);
         }
     }
 }
Example #9
0
        /// <summary>
        /// Init.
        /// </summary>
        public ControlAdapter(Control control)
            : base(PerspexAdapter.Instance)
        {
            ArgChecker.AssertArgNotNull(control, "control");

            _control = control;
        }
 protected void DrawGridFooter(HtmlTextWriter output, Control ctl)
 {
     for (int i = 1; i < 4; i++)
     {
         output.Write("<tr>");
         output.Write("<td height='22'>预选");
         output.Write(i.ToString() + "</td>");
         output.Write("<td bgcolor='#ffffff'>&nbsp;</td>");
         output.Write("<td bgcolor='#ffffff'>&nbsp;</td>");
         for (int k = 0; k < 0x1c; k++)
         {
             output.Write("<td bgcolor='#fdfcdf' onClick=Style(this,'#ff0000','#fdfcdf') style='color:#fdfcdf; cursor:pointer;' ><strong>");
             output.Write(k.ToString() + "</td>");
         }
     }
     output.Write("<tr align='center' valign='center' bgcolor='#e8f1f8' height='18px'>");
     output.Write("<td rowspan='3' >期号</td>");
     output.Write("<td rowspan='3' >开奖号码</td>");
     output.Write("<td rowspan='2' >和值</td>");
     for (int j = 0; j < 0x1c; j++)
     {
         output.Write("<td ><font color='blue'>");
         output.Write(j.ToString() + "</font></td>");
     }
     output.Write("<tr align='center' valign='middle' bgcolor='#e8f1f8' >");
     output.Write("<td colspan='28' height='18px'>位置分布</td>");
     output.Write("<tr align='center' valign='middle' bgcolor='#e8f1f8'>");
     output.Write("<td colspan='29'  height='18px'><strong><font color='red'>和值走势</font></strong></td>");
 }
Example #11
0
    public static TableLayoutPanel GetStacked(Control[] controls, string[] widths)
    {
        TableLayoutPanel layout = new TableLayoutPanel();
        layout.Dock = DockStyle.Fill;
        layout.ColumnCount = 1;
        layout.RowCount = controls.Length;

        foreach (string width in widths) {
            float val = 0F;
            SizeType tp = SizeType.Absolute;
            if (width.EndsWith("%")) {
                val = (float) Convert.ToDouble(width.Remove(width.Length - 1));
                tp = SizeType.Percent;
            } else {
                val = (float) Convert.ToDouble(width);
            }
            layout.RowStyles.Add(new RowStyle(tp, val));
        }

        foreach (Control c in controls) {
            c.Dock = DockStyle.Fill;
            layout.Controls.Add(c);
        }
        return layout;
    }
Example #12
0
 public ControlInvokation(Token Source, Control Control, List<Node> Arguments, Node Body)
     : base(Source)
 {
     this.Control = Control;
     this.Arguments = Arguments;
     this.Body = Body;
 }
        public virtual void SetObject(Control control, object data) {
            if (control == null) {
                throw new ArgumentNullException("control");
            }

            CallbackMethod.Invoke(control, new object[] {data});
        }
Example #14
0
 private void DrawGridFooter(HtmlTextWriter output, Control ctl)
 {
     int num = this.RadioSelete();
     output.Write("<td width = '100px' height='50px'>");
     output.Write("出现次数</td>");
     output.Write("<td width = '100px'>");
     output.Write("&nbsp</td>");
     for (int i = 2; i < this.GridView1.Columns.Count; i++)
     {
         int num3 = 0;
         for (int j = 0; j < this.GridView1.Rows.Count; j++)
         {
             if ((this.GridView1.Rows[j].Cells[i].Text == "0") || (this.GridView1.Rows[j].Cells[i].Text == "1"))
             {
                 //num3 = num3;
                 this.num[i - 2] = num3;
                 this.sum[i - 2] = (num3 * 50) / num;
             }
             if ((((this.GridView1.Rows[j].Cells[i].Text == "2") || (this.GridView1.Rows[j].Cells[i].Text == "3")) || ((this.GridView1.Rows[j].Cells[i].Text == "4") || (this.GridView1.Rows[j].Cells[i].Text == "5"))) || ((this.GridView1.Rows[j].Cells[i].Text == "6") || (this.GridView1.Rows[j].Cells[i].Text == "7")))
             {
                 num3++;
                 this.num[i - 2] = num3;
                 this.sum[i - 2] = (num3 * 50) / num;
             }
         }
         output.Write("<td align='center' valign='bottom'>");
         output.Write(this.num[i - 2].ToString() + "<br><img src='../image/01[1].gif' height='" + this.sum[i - 2].ToString() + "px' title = '" + this.num[i - 2].ToString() + "' width= '8px'></td>");
     }
 }
Example #15
0
		public DialogResult ShowDialog(Control parent, MessageBoxButtons buttons)
		{
			var caption = Caption ?? ((parent != null && parent.ParentWindow != null) ? parent.ParentWindow.Title : null);
            SWF.Control c = (parent == null) ? null : (SWF.Control)parent.ControlObject;
			SWF.DialogResult result = SWF.MessageBox.Show(c, Text, caption, Convert(buttons), Convert(Type));
			return Generator.Convert(result);
		}
Example #16
0
 public TextureGumpling(Control owner, int page, int x, int y, int width, int height)
     : base(owner, page)
 {
     Position = new Point(x, y);
     Size = new Point(width, height);
     HandlesMouseInput = true;
 }
 /// <summary>
 /// Returns <see langword="true"/> if the instance can render <paramref name="control"/>; otherwise <see langword="false"/>.
 /// </summary>
 /// <param name="control">The control to be rendered.</param>
 /// <returns><see langword="true"/> if the instance can render <paramref name="control"/>; otherwise <see langword="false"/>.</returns>
 public override bool CanRender(Control control)
 {
     Type controlType = control.GetType();
     return controlType == typeof(HeadingControl)
         || controlType == typeof(LabelControl)
         || controlType == typeof(HtmlControl);
 }
Example #18
0
        public ATIGPU(string name, int adapterIndex, int busNumber, int deviceNumber, ISettings settings)
            : base(name, new Identifier("atigpu", adapterIndex.ToString(CultureInfo.InvariantCulture)), settings)
        {
            this.adapterIndex = adapterIndex;
            this.busNumber = busNumber;
            this.deviceNumber = deviceNumber;

            this.temperature = new Sensor("GPU Core", 0, SensorType.Temperature, this, settings);
            this.fan = new Sensor("GPU Fan", 0, SensorType.Fan, this, settings);
            this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this, settings);
            this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this, settings);
            this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this, settings);
            this.coreLoad = new Sensor("GPU Core", 0, SensorType.Load, this, settings);
            this.controlSensor = new Sensor("GPU Fan", 0, SensorType.Control, this, settings);

            ADLOD6ThermalControllerCaps adltcc = new ADLOD6ThermalControllerCaps();
            if (ADL.ADL_Overdrive6_ThermalController_Caps(adapterIndex, ref adltcc) != ADL.ADL_OK)
            {
                adltcc.iFanMinPercent = 0;
                adltcc.iFanMaxPercent = 100;
            }

            this.fanControl = new Control(controlSensor, settings, adltcc.iFanMinPercent, adltcc.iFanMaxPercent);
            this.fanControl.ControlModeChanged += ControlModeChanged;
            this.fanControl.SoftwareControlValueChanged += SoftwareControlValueChanged;
            ControlModeChanged(fanControl);
            this.controlSensor.Control = fanControl;
            Update();
        }
Example #19
0
        public void Evaluate(GameTime gameTime, Control focused, UserInterface ui)
        {
            ui.FindControls(Position, _controls);

            foreach (var item in _cooled)
                item.HeatCount--;
            foreach (var item in _warmed)
                item.HeatCount++;

            var type = typeof(MouseDevice);

            for (int i = 0; i < _controls.Count; i++)
            {
                _controls[i].Gestures.Evaluate(gameTime, this);

                if (_controls[i].Gestures.BlockedDevices.Contains(type))
                    break;
            }

            ui.EvaluateGlobalGestures(gameTime, this);

            _previous.Clear();
            _previous.AddRange(_controls);
            _blocked.Clear();
            _controls.Clear();
        }
Example #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImageBox"/> class.
 /// </summary>
 /// <param name="parent">This controls parent control.</param>
 /// <param name="texture">The texture.</param>
 /// <param name="colour">The colour.</param>
 /// <param name="sourceRectangle">The source rectangle.</param>
 public ImageBox(Control parent, Texture2D texture, Color colour, Rectangle? sourceRectangle)
     : base(parent)
 {
     Texture = texture;
     SourceRectangle = sourceRectangle;
     Colour = colour;
 }
Example #21
0
 public static void DisplayScrollingCombatText(Unit unit, String text, ClientCommon.Font font)
 {
     Vector3 pos = Vector3.Project(unit.Position,
         Program.Instance.Device.Viewport.X,
         Program.Instance.Device.Viewport.Y,
         Program.Instance.Device.Viewport.Width,
         Program.Instance.Device.Viewport.Height,
         Program.Instance.Device.Viewport.MinZ,
         Program.Instance.Device.Viewport.MaxZ,
         GameScene.Camera.View * GameScene.Camera.Projection);
     Control f;
     scrollingCombatTexts.Add(new ScrollingCombatText
     {
         Timeout = 1,
         Unit = unit,
         Text = f = new Control(Program.Instance.InterfaceManager)
         {
             Size = new Vector2(300, 100),
             Background = new TextGraphic(Program.Instance.GlyphCache)
             {
                 Text = text,
                 Font = font,
                 Anchor = Orientation.Bottom
             }
         }
     });
     f.Position = pos - new Vector3(f.Size.X/2, f.Size.Y, 0);
     Program.Instance.InterfaceManager.Add(f);
 }
    protected override void AddedControl(Control control, int index)
    {
        if (Request.ServerVariables["http_user_agent"].IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) != -1)
            this.Page.ClientTarget = "uplevel";

        base.AddedControl(control, index);
    }
		protected override bool FilterControl (Control control)
		{
			if (control is WebControl)
				return true;

			return false;
		}		
Example #24
0
		void LayoutDockedChildren (Control parent, Control[] controls)
		{
			Rectangle space = parent.DisplayRectangle;
			MdiClient mdi = null;
			
			// Deal with docking; go through in reverse, MS docs say that lowest Z-order is closest to edge
			for (int i = controls.Length - 1; i >= 0; i--) {
				Control child = controls[i];
				Size child_size = child.Size;

				if (child.AutoSize)
					child_size = GetPreferredControlSize (child);

				if (!child.VisibleInternal
				    || child.ControlLayoutType == Control.LayoutType.Anchor)
					continue;

				// MdiClient never fills the whole area like other controls, have to do it later
				if (child is MdiClient) {
					mdi = (MdiClient)child;
					continue;
				}
				
				switch (child.Dock) {
				case DockStyle.None:
					// Do nothing
					break;

				case DockStyle.Left:
					child.SetBoundsInternal (space.Left, space.Y, child_size.Width, space.Height, BoundsSpecified.None);
					space.X += child.Width;
					space.Width -= child.Width;
					break;

				case DockStyle.Top:
					child.SetBoundsInternal (space.Left, space.Y, space.Width, child_size.Height, BoundsSpecified.None);
					space.Y += child.Height;
					space.Height -= child.Height;
					break;

				case DockStyle.Right:
					child.SetBoundsInternal (space.Right - child_size.Width, space.Y, child_size.Width, space.Height, BoundsSpecified.None);
					space.Width -= child.Width;
					break;

				case DockStyle.Bottom:
					child.SetBoundsInternal (space.Left, space.Bottom - child_size.Height, space.Width, child_size.Height, BoundsSpecified.None);
					space.Height -= child.Height;
					break;
					
				case DockStyle.Fill:
					child.SetBoundsInternal (space.Left, space.Top, space.Width, space.Height, BoundsSpecified.None);
					break;
				}
			}

			// MdiClient gets whatever space is left
			if (mdi != null)
				mdi.SetBoundsInternal (space.Left, space.Top, space.Width, space.Height, BoundsSpecified.None);
		}
 /// <summary>
 /// VerifyRenderingInServerForm.
 /// </summary>
 /// <param name="control">Control</param>
 public override void VerifyRenderingInServerForm(Control control)
 {
     if (!isSaved)
     {
         base.VerifyRenderingInServerForm(control);
     }
 }
Example #26
0
		public SkinBuilder (ThemeProvider provider,
				    Control control,
				    ControlBuilder skinBuilder,
				    string themePath)
		{
			throw new NotImplementedException ();
		}
Example #27
0
 public static void PrintWebControl(Control ctrl, string Script)
 {
     StringWriter stringWrite = new StringWriter();
     System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
     if (ctrl is WebControl)
     {
         Unit w = new Unit(100, UnitType.Percentage); ((WebControl)ctrl).Width = w;
     }
     Page pg = new Page();
     pg.EnableEventValidation = false;
     if (Script != string.Empty)
     {
         pg.ClientScript.RegisterStartupScript(pg.GetType(), "PrintJavaScript", Script);
     }
     HtmlForm frm = new HtmlForm();
     pg.Controls.Add(frm);
     frm.Attributes.Add("runat", "server");
     frm.Controls.Add(ctrl);
     pg.DesignerInitialize();
     pg.RenderControl(htmlWrite);
     string strHTML = stringWrite.ToString();
     HttpContext.Current.Response.Clear();
     HttpContext.Current.Response.Write(strHTML);
     HttpContext.Current.Response.Write("<script>window.print();</script>");
     HttpContext.Current.Response.End();
 }
        public AddComponentView(Sidebar sidebar, Control parent, int Left, int Top, int Height)
            : base(sidebar, parent, Left, Top, false)
        {
            this.Height = Height;
            base.Initialize();
            ItemCreator = Creator;
            ColorChangeOnSelect = false;
            Width = parent.Width - 15;
            sidebar.ui.detailedViews.Remove(this);

            lblCompName = new Label(manager);
            lblCompName.Init();
            lblCompName.Parent = parent;
            lblCompName.Width = 400;
            //lblCompName.Height = 250;
            lblCompName.Top = backPanel.Height + Top;
            lblCompName.Left = 10;
            lblCompName.Text = "";
            lblCompName.TextColor = UserInterface.TomShanePuke;

            lblDescription = new Label(manager);
            lblDescription.Init();
            lblDescription.Parent = parent;
            lblDescription.Width = 400;
            lblDescription.Top = lblCompName.Top + lblCompName.Height;//backPanel.Height + Top + 10;
            lblDescription.Left = 10;
            lblDescription.Height = 70;
            lblDescription.Text = "l";
        }
Example #29
0
		override object Evaluate (HttpContext ctx, Control control)
		{
			if (control == null)
				return null;
			if (control.Page == null)
				return null;
			
			if(String.IsNullOrEmpty(ControlID))
				throw new ArgumentException ("The ControlID property is not set.");

			Control c = null, namingContainer = control.NamingContainer;
			
			while (namingContainer != null) {
				c = namingContainer.FindControl(ControlID);
				if (c != null)
					break;
				namingContainer = namingContainer.NamingContainer;
			}
			if (c == null)
				throw new InvalidOperationException ("Control '" + ControlID + "' not found.");

			string propName = PropertyName;
			if (String.IsNullOrEmpty (propName)) {
				object [] attrs = c.GetType ().GetCustomAttributes (typeof (ControlValuePropertyAttribute), true);
				if(attrs.Length==0)
					throw new ArgumentException ("The PropertyName property is not set and the Control identified by the ControlID property is not decorated with a ControlValuePropertyAttribute attribute.");
				ControlValuePropertyAttribute attr = (ControlValuePropertyAttribute) attrs [0];
				propName = attr.Name;
 			}
			
			return DataBinder.Eval (c, propName);
		}
Example #30
0
 public ColorPicker(Control owner, int page, Rectangle closedArea, Rectangle openArea, int swatchWidth, int swatchHeight, int[] hues)
     : this(owner, page)
 {
     _isAnOpenSwatch = false;
     _openArea = openArea;
     buildGumpling(closedArea, swatchWidth, swatchHeight, hues);
 }