Example #1
0
        private void CreateMenu()
        {
            Table table = new Table();
              TableRow row = new TableRow();
              TableCell cell0 = new TableCell();

              TableCell cell2 = new TableCell();
              TableCell cell3 = new TableCell();
              TableCell cell4 = new TableCell();
              TableCell cell5 = new TableCell();
              TableCell cell6 = new TableCell();
              table.Rows.Add(row);
              row.Cells.Add(cell0);
              // A keyword menu configból jön
              if (Helpers.GetMenuVisibility("SearchKeywordMenu.Visibility"))
              {
            TableCell cell1 = new TableCell();
            row.Cells.Add(cell1);

              }
              row.Cells.Add(cell2);
              row.Cells.Add(cell3);
              row.Cells.Add(cell4);
              row.Cells.Add(cell5);
              row.Cells.Add(cell6);
        }
Example #2
0
        public void InstantiateIn(Control control)
        {
            control.Controls.Clear();
            Table table = new Table();
            table.BorderWidth = Unit.Pixel(0);
            table.CellSpacing = 1;
            table.CellPadding = 0;
            TableRow row = new TableRow();
            row.VerticalAlign = VerticalAlign.Top;
            table.Rows.Add(row);
            TableCell cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.VerticalAlign = VerticalAlign.Middle;
            cell.Controls.Add(First);
            cell.Controls.Add(Previous);
            row.Cells.Add(cell);
            cell = new TableCell();
            cell.HorizontalAlign = HorizontalAlign.Center;
            cell.Controls.Add(Pager);
            row.Cells.Add(cell);
            cell = new TableCell();
            cell.VerticalAlign = VerticalAlign.Middle;
            cell.Controls.Add(Next);
            cell.Controls.Add(Last);
            row.Cells.Add(cell);

            control.Controls.Add(table);
        }
Example #3
0
        private void DrawKenGrid(Grid kenGrid)
        {
            container.Controls.Clear();

            Table tbl = new Table();
            container.Controls.Add(tbl);

            for (int i = 0; i < kenGrid.Dimension; i++)
            {
                TableRow row = new TableRow();
                tbl.Rows.Add(row);

                for (int j = 0; j < kenGrid.Dimension; j++)
                {
                    CellViewModel cellView = new CellViewModel(kenGrid.CellMatrix[i, j]);

                    TableCell cell = new TableCell();
                    DefineBorder(cell, cellView);
                    row.Cells.Add(cell);

                    KenCell kenCell = (KenCell)LoadControl("KenCell.ascx");
                    kenCell.ID = "kencell-" + i.ToString() + "-" + j.ToString();
                    kenCell.Cell = cellView;

                    cell.Controls.Add(kenCell);
                }
            }
        }
      protected void btnGO_Click(object sender, EventArgs e)
      {
      	//url encoded
      	//base64
      	//sha1
      	//encryption with password
	
	string secret = txtString.Text;
	string key = String.IsNullOrEmpty(txtPassword.Text) ? hardCodedKey : txtPassword.Text;
	
      	Table t = new Table();
      	t.Width = new Unit("100%");
	
          t.Rows.Add(MakeRow("Custom Crypto", CustomCryptoEncrypt(secret)));
	t.Rows.Add(MakeRow("URL Encoded:", Server.UrlEncode(secret)));
	t.Rows.Add(MakeRow("Base64 Encoded:", Base64(secret)));
	t.Rows.Add(MakeRow("SHA1 Hashed:", SHA(secret, WG_Hash.Sha1)));
	t.Rows.Add(MakeRow("SHA256 Hashed:", SHA(secret, WG_Hash.Sha256)));
	t.Rows.Add(MakeRow("Rijndael Encrypted: ", Encypt(secret, key), Color.LightGreen));
      
      	ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("BodyContentPlaceholder");
	cph.Controls.Add(new LiteralControl("<p/>"));
       cph.Controls.Add(t);
   
      
      }
Example #5
0
        /// <summary>
        /// Loads an empty (new) row from the database into the specified Table.
        /// <param name="table">The Table object to populate with empty data.</param>
        /// </summary>
        public static void GetEmptyData(Table table)
        {
            Row r = new Row(table);

            for (int i = 0; i < table.Columns.Count; i++)
            {
                RowCell c = new RowCell(table.Columns[i].ColumnId, r) {Row = r};
                if (table.Columns[i].ColumnType == ColumnType.ColumnTemplate)
                    c.Value = ((ColumnTemplate)table.Columns[i]).CreateCellControls;
                else if (c.Value == null && table.Columns[i].DefaultValue != null)
                    c.Value = table.Columns[i].DefaultValue;
                r.Cells.Add(c);
            }

            if (table.m_Grid.MasterWebGrid == null)
            {
                table.Rows.Add(r);
                return;
            }
            List<Column> masterWebGridPrimarykeys = table.m_Grid.MasterWebGrid.MasterTable.Columns.Primarykeys;

            int index = 0;

            while (index < masterWebGridPrimarykeys.Count)
            {
                string columnname = masterWebGridPrimarykeys[index].ColumnId;
                if (r.Columns.GetIndex(columnname) > -1)
                    r[columnname].Value = table.m_Grid.MasterWebGrid.MasterTable.Rows[0][columnname].Value;
                index++;
            }
            table.Rows.Add(r);
        }
        private void populateTable(Table table)
        {
            Dictionary<Product, int> items = Cart.Instance().Items;

            foreach (Product product in items.Keys)
            {
                TableRow row = new TableRow();
                TableCell productCell = new TableCell();
                TableCell descriptionCell = new TableCell();
                TableCell quantityCell = new TableCell();
                TableCell priceCell = new TableCell();
                TableCell totalCell = new TableCell();

                int quantity = items[product];

                productCell.Text = product.Name;
                descriptionCell.Text = product.Description;
                quantityCell.HorizontalAlign = HorizontalAlign.Center;
                quantityCell.Text = quantity.ToString();

                priceCell.Text = String.Format("R$ {0:0.00}", product.Price);
                totalCell.Text = String.Format("R$ {0:0.00}", quantity * product.Price);

                row.Cells.Add(productCell);
                row.Cells.Add(descriptionCell);
                row.Cells.Add(quantityCell);
                row.Cells.Add(priceCell);
                row.Cells.Add(totalCell);

                table.Rows.Add(row);
            }
        }
		private void Page_Load(object sender, System.EventArgs e) 
		{
			//Put user code to initialize the page here
			base.GHTTestBegin((HtmlForm)this.FindControl("Form1"));

			System.Web.UI.WebControls.Table tbl = new System.Web.UI.WebControls.Table();
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());

			//add new cell
			tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
			tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
			tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
			tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());

			tbl.Rows[0].Cells[0].Text = "111";
			tbl.Rows[0].Cells[1].Text = "222";
			tbl.Rows[0].Cells[2].Text = "333";
			tbl.Rows[0].Cells[3].Text = "444";


			try 
			{
				base.GHTSubTestBegin("RemoveAt");
				base.GHTActiveSubTest.Controls.Add(tbl);
				tbl.Rows[0].Cells.RemoveAt(1);
			}
			catch (Exception ex) 
			{
				base.GHTSubTestUnexpectedExceptionCaught(ex);
			}
			base.GHTSubTestEnd();

			base.GHTTestEnd();
		}
 public ExportFromTable(Table table)
 {
     table.Rows.OfType<TableRow>()
         .Where(r => r.Visible)
         .Select(ExportRow)
         .ForEach(ExportTable.AddRow);
 }
        /// <summary>
        /// Initialize table from the DataSet object.
        /// </summary>
        /// <param name="table">Table object to initialize.</param>
        /// <param name="dataSet">Series data.</param>
        /// <param name="tableName">Series name to be used.</param>
        /// <param name="firstColumnWidth">First column width.</param>
        /// <param name="otherColumnWidth">Others columns width.</param>
        public void InitializeTable(Table table, DataSet dataSet, string tableName, int firstColumnWidth, int otherColumnWidth)
        {
            foreach(DataColumn column in dataSet.Tables[tableName].Columns)
            {
                // Create new table row for each column
                TableRow row = new TableRow();

                // Add title cell
                TableCell cell = new TableCell();
                cell.Controls.Add(new LiteralControl(dataSet.Tables[tableName].TableName +
                    " - " + column.ColumnName));
                cell.Width = new Unit(firstColumnWidth, UnitType.Pixel);
                row.Cells.Add(cell);

                // Add data cells
                int pointIndex = 0;
                foreach(DataRow dataRow in dataSet.Tables[tableName].Rows)
                {
                    TableCell dataCell = new TableCell();
                    dataCell.Controls.Add(new LiteralControl(dataRow[column].ToString()));
                    dataCell.Width = new Unit(otherColumnWidth, UnitType.Pixel);
                    dataCell.HorizontalAlign = HorizontalAlign.Center;
                    row.Cells.Add(dataCell);
                    ++pointIndex;
                }

                // Add row into the table
                table.Rows.Add(row);
            }
        }
        private Panel renderSimilarProduct(Item item)
        {
            Panel similarProductsItemContainer = new Panel();
            similarProductsItemContainer.CssClass = "SimilarProductsItemContainer";
            Table table = new Table();
            TableRow tableRow = new TableRow();

            TableCell tableCell = new TableCell();
            Panel itemImageBg = new Panel();
            itemImageBg.CssClass = "itemImageBg";
            Image image = new Image();
            image.ImageUrl = item.ImageUrl;

            itemImageBg.Controls.Add(image);
            tableCell.Controls.Add(itemImageBg);
            tableRow.Controls.Add(tableCell);

            tableCell = new TableCell();
            Panel itemImageTitle = new Panel();
            itemImageTitle.CssClass = "itemImageTitle";
            Label label = new Label();
            label.Text = item.Title;
            itemImageTitle.Controls.Add(label);
            tableCell.Controls.Add(itemImageTitle);
            tableRow.Controls.Add(tableCell);

            table.Controls.Add(tableRow);
            similarProductsItemContainer.Controls.Add(table);

            return similarProductsItemContainer;
        }
Example #11
0
        //public
        /// <summary> 
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void Render(HtmlTextWriter output)
        {
            NdiMenuItem item0 =
            new NdiMenuItem(0, "Állás keresések listája", "Elérhetõ állás keresések szûréssel", "JobFinds.aspx", "_images/searchKexWordS.gif",
                        "_images/searchKexWordL.gif");

              NdiMenuItem item1 =
            new NdiMenuItem(1, "Új állás keresés rögzítése", "Új állás keresés rögzítése", "JobFindCreate.aspx", "_images/searchFreeTextS.gif",
                        "_images/searchFreeTextL.gif");
              NdiMenuItem item2 =
            new NdiMenuItem(2, "Milyen keresésekre válaszoltam", "Milyen  keresésekre válaszoltam", "JobFindMyAnswers.aspx", "_images/searchQuestionFormS.gif",
                        "_images/searchQuestionFormL.gif");

              NdiMenuItem item3 =
            new NdiMenuItem(3, "Saját állás kereséseim", "Saját állás kereséseim", "JobFindsFromMe.aspx", "_images/searchQuestionFormS.gif",
                        "_images/searchQuestionFormL.gif");

              Table table = new Table();
              table.CellPadding = 0;
              table.CellSpacing = 0;
              table.CssClass = "almenu";
              TableRow row1 = new TableRow();
              TableRow row2 = new TableRow();
              TableCell cell0 = CreateCell(item0);

              TableCell cell1 = CreateCell(item1);
              TableCell cell2 = CreateCell(item2);
              TableCell cell3 = CreateCell(item3);

              table.Rows.Add(row2);
              table.Rows.Add(row1);
              if (item0.Index == m_selectedindex)
            row1.Cells.Add(cell0);
              else
            row2.Cells.Add(cell0);

              if (item1.Index == m_selectedindex)
            row1.Cells.Add(cell1);
              else
            row2.Cells.Add(cell1);

              if (item2.Index == m_selectedindex)
            row1.Cells.Add(cell2);
              else
            row2.Cells.Add(cell2);

              if (item3.Index == m_selectedindex)
            row1.Cells.Add(cell3);
              else
            row2.Cells.Add(cell3);

              if (row1.Cells != null && row1.Cells.Count > 0 && row2.Cells != null && row2.Cells.Count > 0)
              {
            row1.Cells[0].ColumnSpan = row2.Cells.Count;

              }
              table.Width = Unit.Percentage(100);

              table.RenderControl(output);
        }
 public static Table GetCentPercentTable()
 {
     Table t = new Table();
     t.Width = new Unit(100.00, UnitType.Percentage);
     t.Attributes.Add("style","table-layout:fixed;");
     return t;
 }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            var tbl = new Table();
            var row = new TableRow();
            var cell = new TableCell
                {
                    ColumnSpan = 2,
                    VerticalAlign = VerticalAlign.Middle,
                    HorizontalAlign = HorizontalAlign.Center
                };

            var lblTitle = new Label {Text = "This WebPart will send a parameter to a consumer:"};
            cell.Controls.Add(lblTitle);
            row.Controls.Add(cell);
            tbl.Controls.Add(row);

            row = new TableRow();
            cell = new TableCell {VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Center};
            _textBox = new TextBox {Text = "", Width = Unit.Pixel(120)};
            cell.Controls.Add(_textBox);
            row.Controls.Add(cell);
            cell = new TableCell {VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Center};
            _button = new Button {Text = "Send..."};
            _button.Click += btn_Click;
            cell.Controls.Add(_button);
            row.Controls.Add(cell);
            tbl.Controls.Add(row);

            Controls.Add(tbl);
        }
Example #14
0
        public void Refresh() {
            
            Controls.Clear();
            if (Page != null) {
                int i = 0;
//                ClientScriptProxy.Current.Page =(Page) ((WebWindowTemplateHttpHandler) HttpContext.Current.Handler).ActualHandler;
                string noImageUrl = ClientScriptProxy.Current.GetWebResourceUrl(GetType(), "Xpand.ExpressApp.Thumbnail.Web.Resources.noimage.jpg");
                if (DataSource != null) {
                    var rootTable = new Table();
                    Controls.Add(rootTable);
                    var tableRow = new TableRow();
                    var tableCell = new TableCell();
                    tableRow.Cells.Add(tableCell);
                    rootTable.Rows.Add(tableRow);
                    foreach (IPictureItem item in DataSource) {
                        Table table = CreateTable(tableCell.Controls);
                        var img = new System.Web.UI.WebControls.Image { ID = ID + "_" + (i++) };
                        var requestTextPictureItemEventArgs = new RequestTextPictureItemEventArgs(item);
                        OnRequestText(requestTextPictureItemEventArgs);
                        SetImageProperties(item, img, noImageUrl,requestTextPictureItemEventArgs.Text);
                        CreateImageRow(img, table);
                        CreateTextRow(item, requestTextPictureItemEventArgs.Text, table);
                    }
                }
            }
        }
        protected override void CreateChildControls()
        {
            PopupBGIButton ok = new PopupBGIButton();
            ok.Text = GetButton("OK");
            ok.Name = "OK";
            ok.CssClass += " " + "ajax__htmleditor_popup_confirmbutton ";

            PopupBGIButton cancel = new PopupBGIButton();
            cancel.Text = GetButton("Cancel");
            cancel.Name = "Cancel";
            cancel.CssClass += " " + "ajax__htmleditor_popup_confirmbutton";

            Table table = new Table();
            table.Attributes.Add("border", "0");
            table.Attributes.Add("cellspacing", "0");
            table.Attributes.Add("cellpadding", "0");
            table.Style["width"] = "100%";

            TableRow row = new TableRow();
            table.Rows.Add(row);
            TableCell cell = new TableCell();
            row.Cells.Add(cell);
            cell.HorizontalAlign = HorizontalAlign.Right;
            cell.Controls.Add(ok);
            cell.Controls.Add(cancel);
            Content.Add(table);

            RegisteredHandlers.Add(new RegisteredField("OK", ok));
            RegisteredHandlers.Add(new RegisteredField("Cancel", cancel));
            base.CreateChildControls();
        }
Example #16
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Table tb = new Table();
            tb.Width = new Unit( 100, UnitType.Percentage );
            TableRow row;
            TableCell cell;

            HyperLink lnk;

            if( Context.User.Identity.IsAuthenticated )
            {
                //create a new blank table row
                row = new TableRow();

                //set up the news link
                lnk = new HyperLink();
                lnk.Text = "News";
                lnk.NavigateUrl = "News.aspx";

                //create the cell and add the link
                cell = new TableCell();
                cell.Controls.Add(lnk);

                //add the new cell to the row
                row.Cells.Add(cell);
            }
            else
            {
                //code for unauthenticated users here
            }

            //finally, add the table to the placeholder
            phNav.Controls.Add(tb);
        }
Example #17
0
        public static void BuildStudentProspectTable(Table table, string userId)
        {
            GroupService service = new GroupService();
            DataTable dtProspects = service.GetProspectiveStudentsData(userId);
            DataTable dtGroups = service.GetSupervisorOfData(userId);

            for (int i = 0; i < dtProspects.Rows.Count; i++)
            {
                DropDownList ddlGroupList = new DropDownList();
                ddlGroupList.DataSource = dtGroups;
                ddlGroupList.DataTextField = "GroupName";
                ddlGroupList.DataValueField = "GroupId";
                ddlGroupList.DataBind();
                ddlGroupList.Items.Insert(0, "Add a group");

                string name = dtProspects.Rows[i].ItemArray[0].ToString();
                string id = dtProspects.Rows[i].ItemArray[1].ToString();

                LinkButton b = new LinkButton();
                b.Text = name;
                b.CommandArgument = id;
                b.CommandName = name;

                TableRow row = new TableRow();
                TableCell cellProspects = new TableCell();
                TableCell cellGroups = new TableCell();

                cellProspects.Controls.Add(b);
                cellGroups.Controls.Add(ddlGroupList);
                row.Cells.Add(cellProspects);
                row.Cells.Add(cellGroups);
                table.Rows.Add(row);
            }
        }
		private void Page_Load(object sender, System.EventArgs e) 
		{
			//Put user code to initialize the page here
			base.GHTTestBegin((HtmlForm)this.FindControl("Form1"));

			System.Web.UI.WebControls.Table tbl = new System.Web.UI.WebControls.Table();
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());

			//add new cell
			tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
			tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
			tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
			tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());

			tbl.Rows[0].Cells[0].Text = "111";
			tbl.Rows[0].Cells[1].Text = "222";
			tbl.Rows[0].Cells[2].Text = "333";
			tbl.Rows[0].Cells[3].Text = "444";

     

			try 
			{
				base.GHTSubTestBegin("Item");
				for (int i = 0; i < tbl.Rows[0].Cells.Count; i++)
					base.GHTSubTestAddResult(" CellText " + i.ToString() + "= " + tbl.Rows[0].Cells[i].Text);
			}
			catch (Exception ex) 
			{
				base.GHTSubTestUnexpectedExceptionCaught(ex);
			}
			base.GHTSubTestEnd();
			base.GHTTestEnd();
		}
		private void Page_Load(object sender, System.EventArgs e) 
		{
			//Put user code to initialize the page here
			base.GHTTestBegin((HtmlForm)this.FindControl("Form1"));

			System.Web.UI.WebControls.Table tbl = new System.Web.UI.WebControls.Table();
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
			tbl.Rows[tbl.Rows.Count - 1].ID = tbl.Rows.Count.ToString();
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
			tbl.Rows[tbl.Rows.Count - 1].ID = tbl.Rows.Count.ToString();
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
			tbl.Rows[tbl.Rows.Count - 1].ID = tbl.Rows.Count.ToString();
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
			tbl.Rows[tbl.Rows.Count - 1].ID = tbl.Rows.Count.ToString();


			try 
			{
				base.GHTSubTestBegin("Remove");
				base.GHTActiveSubTest.Controls.Add(tbl);
				tbl.Rows.Remove(tbl.Rows[1]);
			}
			catch (Exception ex) 
			{
				base.GHTSubTestUnexpectedExceptionCaught(ex);
			}
			base.GHTSubTestEnd();

			base.GHTTestEnd();
		}
Example #20
0
        /// <summary>
        /// Fixes a table so that the last cell in a row has a span that matches the longest row.
        /// </summary>
        /// <param name="table">The table to fix.</param>
        public static void FixColumnSpans(Table table)
        {
            if (table == null)
            throw new ArgumentNullException("table");

              int maxRowWidth = 0;

              // loop through the table's row and get the width of the longest row
              foreach (TableRow row in table.Rows)
              {
            int currentRowWidth = CalculateRowColumnSpan(row);

            if (currentRowWidth > maxRowWidth)
              maxRowWidth = currentRowWidth;
              }

              // loop through the rows and set the final cell to have a colspan that means
              // it's length matches the longest row
              foreach (TableRow row in table.Rows)
              {
            int currentRowWidth = CalculateRowColumnSpan(row);

            if (currentRowWidth < maxRowWidth)
              row.Cells[row.Cells.Count - 1].ColumnSpan = maxRowWidth - currentRowWidth + 1;
              }
        }
Example #21
0
        /// <summary>
        /// BuildMenu builds the top-level menu.  It is called from the OnDataBinding method as well
        /// as from <see cref="CreateChildControls"/>.  It has code to check if the top-level menu should be
        /// laid out horizontally or vertically.
        /// </summary>
        protected virtual void BuildMenu()
        {
            // iterate through the Items
            Table menu = new Table();
            menu.Attributes.Add("id", this.ClientID);

            menu.Width = new Unit("100%");
            //menu.Height = new Unit("100%");
            menu.CellPadding = 0;
            menu.CellSpacing = 0;
           
            // Iterate through the top-level menu's menuitems, and add a <td> tag for each menuItem
            for (int ix = 0; ix < this.items.Count; ix++)
            {
                MainMenuItem mainMenu = this.items[ix];

                TableRow tr = new TableRow();

                BuildMainItems(tr, mainMenu, ix);
                
                menu.Controls.Add(tr);

                if (mainMenu.SubItems.Count > 0)
                {
                    TableRow tr2 = new TableRow();
                    BuildSubItems(tr2, mainMenu,ix);
                    menu.Controls.Add(tr2);
                }
            }

            Controls.Add(menu);
        }
Example #22
0
        private void BuildTable()
        {
            Table table = new Table();

              table.AddHeaderRow(2, "Notary's sign check cookie");

              if (this.cookie != null)
              {
            table.AddRow("You are:", this.cookie.Certificate.FullName);
            table.AddRow(string.Empty, "Sign check cookie set.");
              }
              else
              {
            table.AddRow("You are:", "Unknown");
              }

              table.AddSpaceRow(2, 32);

              if (!this.valid)
              {
            table.AddRow(string.Empty, this.message);

            if (!string.IsNullOrEmpty(this.error))
            {
              table.AddRow(string.Empty, this.error);
            }
              }

              mainPanel.Controls.Add(table);
        }
        protected override void CreateChildControls()
        {
            Table table = new Table();
            table.Attributes.Add("border", "0");
            table.Attributes.Add("cellspacing", "0");
            table.Attributes.Add("cellpadding", "0");
            table.Style[HtmlTextWriterStyle.Margin] = "1px";
            table.Style[HtmlTextWriterStyle.Padding] = "0px";
            TableRow row = new TableRow();
            TableCell cell = new TableCell();
            table.Rows.Add(row);
            row.Cells.Add(cell);
            if (this.MethodButton != null)
            {
                cell.Controls.Add(this.MethodButton);
            }
            row = new TableRow();
            cell = new TableCell();
            table.Rows.Add(row);
            row.Cells.Add(cell);
            ColorDiv = new DesignModeBoxButton();
            ColorDiv.CssClass = "";
            ColorDiv.Style[HtmlTextWriterStyle.Margin] = "0px";
            ColorDiv.Style[HtmlTextWriterStyle.Padding] = "0px";
            ColorDiv.Width = new Unit(21, UnitType.Pixel);
            ColorDiv.Height = new Unit(5, UnitType.Pixel);
            ColorDiv.Style["background-color"] = DefaultColor;
            ColorDiv.Style["font-size"] = "1px";
            cell.Controls.Add(ColorDiv);

            Content.Add(table);

            base.CreateChildControls();
        }
Example #24
0
      protected void btnGO_Click(object sender, EventArgs e)
      {
      	//url encoded
      	//base64
      	//sha1
      	//encryption with password
	
	string s = txtString.Text;
	//string p = txtPassword.Text;
	
      	Table t = new Table();
      	t.Width = new Unit("100%");
	
	t.Rows.Add(MakeRow("URL Encoded:", Server.UrlEncode(s)));
	t.Rows.Add(MakeRow("Base64 Encoded:", Base64(s)));
	t.Rows.Add(MakeRow("SHA1 Hashed:", SHA(s, WG_Hash.Sha1)));
	t.Rows.Add(MakeRow("SHA256 Hashed:", SHA(s, WG_Hash.Sha256)));
	
      
      	ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("BodyContentPlaceholder");
	cph.Controls.Add(new LiteralControl("<p/>"));
       cph.Controls.Add(t);
   
      
      }
        protected override void CreateChildControls()
        {
            Table table = new Table();
            for (int i = 0; i < _colors.Length; i++)
            {
                TableRow row = new TableRow();
                table.Rows.Add(row);
                for (int j = 0; j < _colors[i].Length; j++)
                {
                    TableCell cell = new TableCell();
                    cell.Style[HtmlTextWriterStyle.Width] = "10px";
                    cell.Style[HtmlTextWriterStyle.Height] = "10px";
                    cell.Style[HtmlTextWriterStyle.Cursor] = "pointer";
                    cell.Style["background-color"] = "#" + _colors[i][j];
                    cell.Attributes.Add("onclick", "setColor(\"#" + _colors[i][j] + "\")");
                    row.Cells.Add(cell);

                    HtmlGenericControl innerDiv = new HtmlGenericControl("div");
                    innerDiv.Style[HtmlTextWriterStyle.Height] = "100%";
                    innerDiv.Style[HtmlTextWriterStyle.Width] = "100%";
                    innerDiv.Style["font-size"] = "1px";
                    cell.Controls.Add(innerDiv);
                }
            }
            table.Attributes.Add("border", "0");
            table.Attributes.Add("cellspacing", "1");
            table.Attributes.Add("cellpadding", "0");
            table.Style["background-color"] = "#000000";

            Content.Add(table);

            base.CreateChildControls();
        }
Example #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var temp = new Movie();
            var movies = temp.getAll();

            Table table = new Table();
            foreach (int moid in movies.Keys) {
                TableRow row = new TableRow();

                TableCell imageCell = new TableCell();
                Image image = new Image();
                image.ImageUrl = movies[moid].read("imgurl").ToString();

                HtmlAnchor anchor = new HtmlAnchor();
                anchor.HRef = "/show_movie.aspx?moid=" + movies[moid].id;
                anchor.Controls.Add(image);

                imageCell.Controls.Add(anchor);
                row.Controls.Add(imageCell);

                TableCell cell = new TableCell();
                cell.VerticalAlign = VerticalAlign.Top;

                cell.Text = "<h2>" + movies[moid].read("title").ToString() + "</h2>";
                row.Controls.Add(cell);
                cell.Text += (movies[moid].read("description").ToString().Length > 1024) ? movies[moid].read("description").ToString().Substring(0, 1024) + "..." : movies[moid].read("description").ToString();
                row.Controls.Add(cell);

                table.Controls.Add(row);
            }
            PlaceHolder1.Controls.Add(table);
        }
Example #27
0
        void AddNewRow(Entities.ProductionEntity production, Table table)
        {
            var row = new TableRow();
            row.ID = "rId_" + production.ProductionCode;
            row.Cells.Add(new TableCell { Text = production.ProductionCode.ToString() });
            row.Cells.Add(new TableCell { Text = production.NameProduction.ToString() });
            row.Cells.Add(new TableCell { Text = production.DesignationProduction.ToString() });

            //
            // Раскоментить или удалить, уточнить
            //
            //if (production.CountProduction==null)
            //    row.Cells.Add(new TableCell { Text = "0" });
            //else
            //    row.Cells.Add(new TableCell { Text = production.CountProduction.ToString() });

            //if (production.UnitName == null)
            //    row.Cells.Add(new TableCell { Text = "-" });
            //else
            //    row.Cells.Add(new TableCell { Text = production.UnitName.ToString() });

            row.Cells.Add(new TableCell { Text = production.TypeName.ToString() });
            row.Cells.Add(new TableCell { Text = production.SortName.ToString() });
            row.Cells.Add(new TableCell { Text = production.SignName.ToString() });
            row.Cells.Add(new TableCell { Text = "<a href=\"/DeleteView/DeleteProduction.aspx?IdProduction=" + production.ProductionCode.ToString() + "\">удалить</a>" });
            row.Cells.Add(new TableCell { Text = "<a href=\"/EditingForms/ProductionEdit.aspx?IdProduction=" + production.ProductionCode.ToString() + "\">изменить</a>" });
            row.CssClass = "activeRow";
            table.Rows.Add(row);
        }
 /// <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;
 }
		private void Page_Load(object sender, System.EventArgs e) 
		{
			//Put user code to initialize the page here
			base.GHTTestBegin((HtmlForm)this.FindControl("Form1"));

			System.Web.UI.WebControls.Table tbl1 = new System.Web.UI.WebControls.Table();
			tbl1.Rows.Add(new System.Web.UI.WebControls.TableRow());

			System.Web.UI.WebControls.Table tbl = new System.Web.UI.WebControls.Table();
			tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());

			try 
			{
				base.GHTSubTestBegin("Add cells");
				base.GHTActiveSubTest.Controls.Add(tbl);
				base.GHTActiveSubTest.Controls.Add(tbl1);

				// add new cell
				tbl1.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
				tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
				System.Web.UI.WebControls.TableCell tblCell = new System.Web.UI.WebControls.TableCell();
				tbl.Rows[0].Cells.Add(tblCell);
			
				// add cell from one table to another
				tbl.Rows[0].Cells.Add(tbl1.Rows[0].Cells[0]);
			}
			catch (Exception ex) 
			{
				base.GHTSubTestUnexpectedExceptionCaught(ex);
			}
			base.GHTSubTestEnd();

			base.GHTTestEnd();

		}
        /// <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;
        }