private static void ApplyCommonStyle(Label lbl) { lbl.Font.Name = "Arial"; lbl.Font.Size = FontUnit.Parse("18px", CultureInfo.InvariantCulture); lbl.Font.Bold = true; lbl.Style[HtmlTextWriterStyle.Padding] = "3px 8px 3px 8px"; }
private void SetTableTitle(string tabTitle) { this.Table1.Visible = true; this.Table1.Rows[0].Cells[0].Text = tabTitle; this.Table1.Rows[0].Cells[0].Font.Size = FontUnit.Parse("12pt"); this.Table1.Rows[0].Height = Unit.Parse("25pt"); }
/// <summary> /// 将菜单绑定到TreeView. /// </summary> /// <param name="target">菜单项所链接地址打开的方式</param> /// <param name="list">数据源</param> protected void BindTreeView(string target, List <Model.SysFun> list) { this.tvAdmin.Nodes.Clear(); this.tvAdmin.Font.Name = "黑体"; this.tvAdmin.Font.Size = FontUnit.Parse("92"); for (int i = 0; i < list.Count; i++) { if (list[i].ParentNodeId == 0)//表示绑定根菜单. { string nodeID = list[i].NodeId.ToString(); string text = list[i].DisplayName; //string url=list //string imageUrl = list[i].ImageUrl; // int pemissionID = list[i].PermissionID;//菜单权限编号 //BLL.UserBLL bll = new BLL.UserBLL(); //ArrayList arrayList = bll.GetPermissionIDList(Convert.ToInt32(Session["UserID"]));//根据用户的编号,得到用户的权限编号 //在用户所具有的权限编号中查找指定的菜单的权限编号。 // if (arrayList.Contains(pemissionID) || pemissionID == -1) // { TreeNode node = new TreeNode(); node.Value = nodeID; node.Text = text; // node.ImageUrl = "../" + imageUrl; node.Expanded = true; this.tvAdmin.Nodes.Add(node); BindChildTreeNodes(Convert.ToInt32(nodeID), target, node.ChildNodes, list); //} } } }
protected void Page_Load(object sender, EventArgs e) { Poll1.ID = "Poll1"; Poll1.DataSourceID = "SqlDataSource1"; Poll1.VotingMode = PollVotingMode.SingleAnswer; Poll1.MinAnswers = 1; Poll1.Title = "Favorite Movie"; Poll1.Question = "What is your favorite movie?"; Poll1.AllowedVotesPerUser = 100; phPoll1.Controls.Add(Poll1); Poll1.AnswerStyle.Font.Size = FontUnit.Parse(AnswersFontSize.Text); Poll1.AnswerStyle.Font.Bold = AnswersFontBold.Checked; Poll1.AnswerStyle.Font.Italic = AnswersFontItalic.Checked; Poll1.AnswerStyle.ForeColor = Color.FromName(AnswersForeColor.Text); Poll1.ResultStyle.Font.Size = FontUnit.Parse(ResultsFontSize.Text); Poll1.ResultStyle.Font.Bold = ResultsFontBold.Checked; Poll1.ResultStyle.Font.Italic = ResultsFontItalic.Checked; Poll1.ResultStyle.ForeColor = Color.FromName(ResultsForeColor.Text); Poll1.TitleStyle.Font.Size = FontUnit.Parse(TitleFontSize.Text); Poll1.TitleStyle.Font.Bold = TitleFontBold.Checked; Poll1.TitleStyle.Font.Italic = TitleFontItalic.Checked; Poll1.TitleStyle.ForeColor = Color.FromName(TitleForeColor.Text); Poll1.QuestionStyle.Font.Size = FontUnit.Parse(QuestionFontSize.Text); Poll1.QuestionStyle.Font.Bold = QuestionFontBold.Checked; Poll1.QuestionStyle.Font.Italic = QuestionFontItalic.Checked; Poll1.QuestionStyle.ForeColor = Color.FromName(QuestionForeColor.Text); }
private void PicturePanel_DataBinding(object sender, EventArgs e) { Panel panel = (Panel)sender; File file = (File)DataBinder.GetDataItem(panel.NamingContainer); var fileMimeTypeGroups = MimeType.GetGroups(file.Name, true); bool isImage = (fileMimeTypeGroups & MimeTypeGroups.Image) == MimeTypeGroups.Image; if (isImage) { Picture = new Image(); Picture.ImageUrl = m_FileList.FileManager.GetThumbnailUrl(file.FileId, 0, 0, 0, true); panel.Controls.Add(Picture); } else { IconLabel = new Label(); IconLabel.CssClass = GetFileTypeIconCssClass(fileMimeTypeGroups); string fontSize = string.Format(CultureInfo.InvariantCulture, "{0}px", (int)IconSize.Bigger); IconLabel.Font.Size = FontUnit.Parse(fontSize, CultureInfo.InvariantCulture); IconLabel.Style["line-height"] = fontSize; panel.Controls.Add(IconLabel); } }
private void AutoCarMenu(TreeView trvMenu) { trvMenu.Nodes.Clear(); trvMenu.Font.Name = "宋体"; trvMenu.Font.Size = FontUnit.Parse("10"); string strSql = "select t_R_RoleMenu.MenuID,MenuName,URL from t_R_Role,t_R_Menu,t_R_RoleMenu " + " where t_R_Role.RoleID=t_R_RoleMenu.RoleID and " + " t_R_RoleMenu.MenuID=t_R_Menu.ID and " + " t_R_Role.RoleID='" + Request.Cookies["Cookies"].Values["u_role"].ToString() + "' and " + "t_R_Menu.FatherID='0' and t_R_Menu.flag>=1 and t_R_RoleMenu.checked='1' and t_R_Menu.id=63 order by t_R_Menu.OrderID"; DataSet ds = new MyDataOp(strSql).CreateDataSet(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { TreeNode tnFather = new TreeNode(); tnFather.Text = ds.Tables[0].Rows[i]["MenuName"].ToString(); tnFather.NavigateUrl = ds.Tables[0].Rows[i]["URL"].ToString(); if (tnFather.NavigateUrl == "#") { tnFather.Expanded = true; } else { tnFather.Expanded = true; } trvMenu.Nodes.Add(tnFather); CreateCarChildNodes(tnFather, Int16.Parse(ds.Tables[0].Rows[i]["MenuID"].ToString())); } ds.Dispose(); }
/// <summary> /// Default constrcutor. /// </summary> public LayoutPopupTitle() { BackGradientFirstColor = Color.FromArgb(0x0A, 0x24, 0x6A); BackGradientLastColor = Color.FromArgb(0xA6, 0xCA, 0xF0); Font.Bold = true; Font.Name = "Verdana"; Font.Size = FontUnit.Parse("10pt"); }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); base.Text = "*"; base.Display = ValidatorDisplay.Dynamic; base.ForeColor = Color.Red; base.Font.Size = FontUnit.Parse("16"); }
//创建子控件(服务器日历控件) protected override void CreateChildControls() { Controls.Clear(); _Label = new Label(); _Label.ID = MyLabelID; _Label.Font.Size = FontUnit.Parse("9pt"); _Label.Font.Name = "Verdana"; this.Controls.Add(_Label); }
void InitTreeView() { NodeStyle.HorizontalPadding = 4; NodeStyle.ForeColor = Color.Black; NodeStyle.Font.Names = new string[] { "Tahoma", "Verdana", "Geneva", "Arial", "Helvetica", "sans-serif" }; NodeStyle.Font.Size = FontUnit.Parse("11px", null); HoverNodeStyle.Font.Underline = true; SelectedNodeStyle.Font.Underline = false; SelectedNodeStyle.ForeColor = Color.White; SelectedNodeStyle.BackColor = Color.FromArgb(0x316AC5); }
private static FontUnit toFontUnit(string text, FontUnit defaultValue) { if (string.IsNullOrEmpty(text)) { return(defaultValue); } try { return(FontUnit.Parse(text.Trim('\''))); } catch { return(defaultValue); } }
private void RenderLegendTag(HtmlTextWriter writer) { if (this.Title.Length > 0) { Legend legend = new Legend(); legend.Text = Title; legend.Font.Size = FontUnit.Parse("1.5em", System.Globalization.CultureInfo.InvariantCulture); if (this._titleStyle != null) { legend.ControlStyle.CopyFrom(this._titleStyle); } legend.RenderControl(writer); } }
protected override Style CreateControlStyle() { Style style = new Style(); style.Font.Names = new string[] { "Tahoma", "Verdana", "Geneva", "Arial", "Helvetica", "sans-serif" }; style.Font.Size = FontUnit.Parse("11px", null); style.BorderStyle = _defaultBorderStyle; style.BorderWidth = _defaultBorderWidth; style.BorderColor = _defaultBorderColor; style.BackColor = _defaultBackColor; style.ForeColor = _defaultForeColor; style.Width = _defaultWidth; style.Height = _defaultHeight; return(style); }
public static Boolean IsFontUnit(Object inValue) { Boolean ReturnValue = false; try { Object Result = FontUnit.Parse(Cast.ToString(inValue)); ReturnValue = true; } catch { ReturnValue = false; } return(ReturnValue); }
protected void ddlSideBarFontSizes_SelectedIndexChanged(object sender, EventArgs e) { try { if (rblSideBarFontSizeByName.Checked == true && ddlSideBarFontSizes.SelectedIndex > 0) { //lblSideBarFont.Font.Size = new FontUnit((FontSize)Enum.Parse(typeof(FontSize), ddlSideBarFontSizes.Text)); lblSideBarFont.Font.Size = FontUnit.Parse(ddlSideBarFontSizes.SelectedItem.Text); } } catch (Exception ex) { lblErr.Text = ex.Message; } }
protected void update_Click(object sender, EventArgs e) { pnlMag.BackColor = ColorTranslator.FromHtml(backList.SelectedItem.Text); dp.ImageUrl = imageList.SelectedItem.Value; heading.Font.Name = headingFamily.SelectedItem.Text; heading.Font.Size = FontUnit.Parse(headingSize.Text); heading.ForeColor = ColorTranslator.FromHtml(headingColor.Text); heading.Text = headingText.Text; body.Font.Name = bodyFamily.SelectedItem.Text; body.Font.Size = FontUnit.Parse(bodySize.Text); body.ForeColor = ColorTranslator.FromHtml(bodyColor.Text); body.Text = bodyText.Text; dp.Visible = true; }
/// /// <summary> /// Loads the control. /// </summary> /// <remarks> /// Note for inheritors - for this control to function properly, any derived controls that override /// this method should ensure that they call this base method as part of their OnLoad. /// </remarks> /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param> /// protected override void OnLoad(EventArgs e) { base.OnLoad(e); _realField.OnLoad(e); if (!ControlHelper.IsPostBack) { if (ControlStyle.Font.Size.IsEmpty) { ControlStyle.Font.Size = FontUnit.Parse("12pt"); } base.Text = _realField.GetHiddenFieldText(); } return; }
void SetContextMenuStyle(Menu menu) { // TODO menu.DynamicMenuStyle.BackColor = Color.White; menu.DynamicMenuStyle.BorderStyle = BorderStyle.Solid; menu.DynamicMenuStyle.BorderWidth = Unit.Pixel(1); menu.DynamicMenuStyle.BorderColor = Color.FromArgb(0xACA899); menu.DynamicMenuStyle.HorizontalPadding = Unit.Pixel(2); menu.DynamicMenuStyle.VerticalPadding = Unit.Pixel(2); menu.DynamicMenuItemStyle.ForeColor = Color.Black; menu.DynamicMenuItemStyle.Font.Names = new string [] { "Tahoma", "Verdana", "Geneva", "Arial", "Helvetica", "sans-serif" }; menu.DynamicMenuItemStyle.VerticalPadding = Unit.Pixel(1); menu.DynamicMenuItemStyle.Font.Size = FontUnit.Parse("11px", null); menu.DynamicHoverStyle.ForeColor = Color.White; menu.DynamicHoverStyle.BackColor = Color.FromArgb(0x316AC5); }
//邦定根节点 public void BindTreeView(string TargetFrame, DataTable dt) { DataRow[] drs = dt.Select("ParentID= " + 0);// 选出所有子节点 //菜单状态 string MenuExpanded = ConfigurationManager.AppSettings.Get("MenuExpanded"); bool menuExpand = bool.Parse(MenuExpanded); TreeView1.Nodes.Clear(); // 清空树 foreach (DataRow r in drs) { string nodeid = r["NodeID"].ToString(); string text = r["Text"].ToString(); string parentid = r["ParentID"].ToString(); string location = r["Location"].ToString(); string url = r["Url"].ToString(); string imageurl = r["ImageUrl"].ToString(); int permissionid = int.Parse(r["PermissionID"].ToString().Trim()); string framename = TargetFrame; //treeview set this.TreeView1.Font.Name = "宋体"; this.TreeView1.Font.Size = FontUnit.Parse("9"); //权限控制菜单 if ((permissionid == -1) || (user.HasPermissionID(permissionid)))//绑定用户有权限的和没设权限的(即公开的菜单) { // TreeNode rootnode = new TreeNode(); TreeNode rootnode = new TreeNode(); rootnode.Text = text; rootnode.Value = nodeid; rootnode.NavigateUrl = url; rootnode.Target = framename; rootnode.Expanded = menuExpand; rootnode.ImageUrl = imageurl; TreeView1.Nodes.Add(rootnode); int sonparentid = int.Parse(nodeid);// or =location CreateNode(framename, sonparentid, rootnode, dt); } } }
//邦定根节点 public void BindTreeView() { Maticsoft.BLL.Products.Category bll = new Maticsoft.BLL.Products.Category(); DataTable dt = bll.GetAllList().Tables[0]; DataRow[] drs = dt.Select("ParentID= " + 0);// 选出所有子节点 //菜单状态 bool menuExpand = true; TreeView1.Nodes.Clear(); // 清空树 foreach (DataRow r in drs) { string ClassID = r["CategoryId"].ToString(); string ClassDesc = "<b>" + r["Name"].ToString() + "</b>"; string ParentId = r["ParentId"].ToString(); //string Orders = r["Orders"].ToString(); //string IsShow = r["IsShow"].ToString(); //if (IsShow == "false") //{ // ClassDesc = ""; //} //treeview set this.TreeView1.Font.Name = "宋体"; this.TreeView1.Font.Size = FontUnit.Parse("9"); Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode(); rootnode.Text = ClassDesc; rootnode.NodeData = ClassID; //rootnode.NavigateUrl = url; //rootnode.Target = framename; rootnode.Expanded = menuExpand; //rootnode.ImageUrl = imageurl; TreeView1.Nodes.Add(rootnode); int sonparentid = int.Parse(ClassID);// or =location CreateNode(sonparentid, rootnode, dt); } }
protected void ButtonFontSizeOk_Click(object sender, EventArgs e) { ButtonHeightOk_Click(sender, e); ButtonHeightOk.Click -= new EventHandler(ButtonHeightOk_Click); if (TextBoxFontSize.Text.Trim() == "" || TextBoxFontSize.Text.Trim() == "0") { primaryStyle.Font.Size = new FontUnit(); } else { try { primaryStyle.Font.Size = FontUnit.Parse(TextBoxFontSize.Text); } catch { } } }
//邦定根节点 public void BindTreeView() { Maticsoft.BLL.SysManage bll = new Maticsoft.BLL.SysManage(); DataTable dt = bll.GetTreeList("").Tables[0]; DataRow[] drs = dt.Select("ParentID= " + 0);//选出所有子节点 //菜单状态 bool menuExpand = false; TreeView1.Nodes.Clear(); // 清空树 foreach (DataRow r in drs) { string nodeid = r["NodeID"].ToString(); string text = r["Text"].ToString(); string parentid = r["ParentID"].ToString(); string location = r["Location"].ToString(); string url = r["Url"].ToString(); string imageurl = r["ImageUrl"].ToString(); int permissionid = int.Parse(r["PermissionID"].ToString().Trim()); //treeview set this.TreeView1.Font.Name = "宋体"; this.TreeView1.Font.Size = FontUnit.Parse("9"); Microsoft.Web.UI.WebControls.TreeNode rootnode = new Microsoft.Web.UI.WebControls.TreeNode(); rootnode.Text = text + " <a href=\"modify.aspx?id=" + nodeid + "\">修改</a> " + " <a onClick=\"if (!window.confirm('您真的要删除这条记录吗?')){return false;}\" href=\"delete.aspx?id=" + nodeid + "\">删除</a>" + " <a href=\"add.aspx?nodeid=" + nodeid + "\">增加节点</a>"; rootnode.NodeData = nodeid; //rootnode.NavigateUrl = url; //rootnode.Target = framename; rootnode.Expanded = menuExpand; rootnode.ImageUrl = "../" + imageurl; TreeView1.Nodes.Add(rootnode); int sonparentid = int.Parse(nodeid);// or =location CreateNode(sonparentid, rootnode, dt); } }
protected void Page_Load(object sender, EventArgs e) { Poll1.AnswerStyle.Font.Size = FontUnit.Parse(AnswersFontSize.Text); Poll1.AnswerStyle.Font.Bold = AnswersFontBold.Checked; Poll1.AnswerStyle.Font.Italic = AnswersFontItalic.Checked; Poll1.AnswerStyle.ForeColor = Color.FromName(AnswersForeColor.Text); Poll1.ResultStyle.Font.Size = FontUnit.Parse(ResultsFontSize.Text); Poll1.ResultStyle.Font.Bold = ResultsFontBold.Checked; Poll1.ResultStyle.Font.Italic = ResultsFontItalic.Checked; Poll1.ResultStyle.ForeColor = Color.FromName(ResultsForeColor.Text); Poll1.TitleStyle.Font.Size = FontUnit.Parse(TitleFontSize.Text); Poll1.TitleStyle.Font.Bold = TitleFontBold.Checked; Poll1.TitleStyle.Font.Italic = TitleFontItalic.Checked; Poll1.TitleStyle.ForeColor = Color.FromName(TitleForeColor.Text); Poll1.QuestionStyle.Font.Size = FontUnit.Parse(QuestionFontSize.Text); Poll1.QuestionStyle.Font.Bold = QuestionFontBold.Checked; Poll1.QuestionStyle.Font.Italic = QuestionFontItalic.Checked; Poll1.QuestionStyle.ForeColor = Color.FromName(QuestionForeColor.Text); }
private void PictureLink_DataBinding(object sender, EventArgs e) { HyperLink link = (HyperLink)sender; File file = (File)DataBinder.GetDataItem(link.NamingContainer); var fileMimeTypeGroups = MimeType.GetGroups(file.Name, true); bool isImage = (fileMimeTypeGroups & MimeTypeGroups.Image) == MimeTypeGroups.Image; link.NavigateUrl = file.Url; if (file.Extension.In(MimeType.SwfExtension) || isImage) { link.Target = "_blank"; link.Attributes["rel"] = "noopener"; } if (isImage) { Picture = new Image(); Picture.Width = Unit.Pixel(ThumbnailWidth); Picture.Height = Unit.Pixel(ThumbnailHeight); Picture.ImageUrl = m_FileList.FileManager.GetThumbnailUrl(file.FileId, ThumbnailWidth, ThumbnailHeight, 1, false); link.Controls.Add(Picture); } else { link.CssClass = GetFileTypeIconCssClass(fileMimeTypeGroups); string fontSize = string.Format(CultureInfo.InvariantCulture, "{0}px", ThumbnailHeight); link.Font.Size = FontUnit.Parse(fontSize, CultureInfo.InvariantCulture); link.Style["line-height"] = fontSize; } }
//创建子控件(服务器日历控件) protected override void CreateChildControls() { Controls.Clear(); _Calendar = new Calendar(); _Calendar.ID = MyCalendarID; _Calendar.SelectedDate = DateTime.Parse(Text); _Calendar.TitleFormat = TitleFormat.MonthYear; _Calendar.NextPrevFormat = NextPrevFormat.ShortMonth; _Calendar.CellSpacing = 0; _Calendar.Font.Size = FontUnit.Parse("9pt"); _Calendar.Font.Name = "Verdana"; _Calendar.SelectedDayStyle.BackColor = ColorTranslator.FromHtml("#333399"); _Calendar.SelectedDayStyle.ForeColor = ColorTranslator.FromHtml("White"); _Calendar.DayStyle.BackColor = ColorTranslator.FromHtml("#CCCCCC"); _Calendar.TodayDayStyle.BackColor = ColorTranslator.FromHtml("#999999"); _Calendar.TodayDayStyle.ForeColor = ColorTranslator.FromHtml("Aqua"); _Calendar.DayHeaderStyle.Font.Size = FontUnit.Parse("8pt"); _Calendar.DayHeaderStyle.Font.Bold = true; _Calendar.DayHeaderStyle.Height = Unit.Parse("8pt"); _Calendar.DayHeaderStyle.ForeColor = ColorTranslator.FromHtml("#333333"); _Calendar.NextPrevStyle.Font.Size = FontUnit.Parse("8pt"); _Calendar.NextPrevStyle.Font.Bold = true; _Calendar.NextPrevStyle.ForeColor = ColorTranslator.FromHtml("White"); _Calendar.TitleStyle.Font.Size = FontUnit.Parse("12pt"); _Calendar.TitleStyle.Font.Bold = true; _Calendar.TitleStyle.Height = Unit.Parse("12pt"); _Calendar.TitleStyle.ForeColor = ColorTranslator.FromHtml("White"); _Calendar.TitleStyle.BackColor = ColorTranslator.FromHtml("#333399"); _Calendar.OtherMonthDayStyle.ForeColor = ColorTranslator.FromHtml("#999999"); _Calendar.NextPrevFormat = NextPrevFormat.CustomText; _Calendar.NextMonthText = "下月"; _Calendar.PrevMonthText = "上月"; _Calendar.Style.Add("display", "none"); //默认不显示下拉日历控件 _Calendar.SelectionChanged += new EventHandler(_Calendar_SelectionChanged); this.Controls.Add(_Calendar); }
protected override object Read(byte token, BinaryReader r, ReaderContext ctx) { return(FontUnit.Parse((string)base.Read(token, r, ctx))); }
protected void rblWeekdayTextSize_SelectedIndexChanged(object sender, EventArgs e) { calEvents.DayHeaderStyle.Font.Size = FontUnit.Parse(rblWeekdayTextSize.SelectedValue); }
protected void rblCalendarTextSize_SelectedIndexChanged(object sender, EventArgs e) { calEvents.DayStyle.Font.Size = FontUnit.Parse(rblCalendarTextSize.Text); calEvents.TitleStyle.Font.Size = FontUnit.Parse(rblCalendarTextSize.Text); }
public void customizeCalendar() { SqlConnection con = new SqlConnection(); con.ConnectionString = ConfigurationManager.ConnectionStrings["KalendarDB"].ConnectionString; SqlCommand com = new SqlCommand(); com.Connection = con; com.CommandText = "SELECT * FROM Preferences WHERE UserName=@UserName"; com.Parameters.AddWithValue("@UserName", User.Identity.Name); try { con.Open(); SqlDataReader reader = com.ExecuteReader(); reader.Read(); calEvents.Width = Unit.Percentage(Convert.ToDouble(reader[1].ToString())); calEvents.Height = Unit.Pixel(Convert.ToInt32(reader[1].ToString()) * 10); gvEvents.Width = calEvents.Width; calEvents.BackColor = System.Drawing.Color.FromName(reader[2].ToString()); gvEvents.AlternatingRowStyle.BackColor = calEvents.BackColor; calEvents.TitleStyle.BackColor = System.Drawing.Color.FromName(reader[3].ToString()); gvEvents.HeaderStyle.BackColor = calEvents.TitleStyle.BackColor; calEvents.DayStyle.Font.Size = FontUnit.Parse(reader[4].ToString()); calEvents.TitleStyle.Font.Size = FontUnit.Parse(reader[4].ToString()); gvEvents.Font.Size = calEvents.DayStyle.Font.Size; calEvents.DayStyle.BorderStyle = (BorderStyle)Enum.Parse(typeof(BorderStyle), reader[5].ToString()); calEvents.DayHeaderStyle.BorderStyle = (BorderStyle)Enum.Parse(typeof(BorderStyle), reader[5].ToString()); gvEvents.RowStyle.BorderStyle = calEvents.DayStyle.BorderStyle; calEvents.DayNameFormat = (DayNameFormat)Enum.Parse(typeof(DayNameFormat), reader[6].ToString()); calEvents.DayHeaderStyle.Font.Size = FontUnit.Parse(reader[7].ToString()); calEvents.TodayDayStyle.BackColor = System.Drawing.Color.FromName(reader[8].ToString()); gvEvents.PagerStyle.BackColor = calEvents.TodayDayStyle.BackColor; calEvents.SelectedDayStyle.BackColor = System.Drawing.Color.FromName(reader[9].ToString()); gvEvents.SelectedRowStyle.BackColor = calEvents.SelectedDayStyle.BackColor; if (Convert.ToBoolean(reader[10])) { calEvents.NextPrevFormat = NextPrevFormat.FullMonth; } else { calEvents.NextPrevFormat = NextPrevFormat.CustomText; } rblSize.SelectedIndex = rblSize.Items.IndexOf(rblSize.Items.FindByValue(calEvents.Width.Value.ToString())); ddlBackground.SelectedIndex = ddlBackground.Items.IndexOf(new ListItem(calEvents.BackColor.Name.ToString())); ddlHeader.SelectedIndex = ddlHeader.Items.IndexOf(new ListItem(calEvents.TitleStyle.BackColor.Name.ToString())); rblCalendarTextSize.SelectedIndex = rblCalendarTextSize.Items.IndexOf(rblCalendarTextSize.Items.FindByValue(calEvents.DayStyle.Font.Size.Type.ToString())); ddlDayBorderStyle.SelectedIndex = ddlDayBorderStyle.Items.IndexOf(new ListItem(calEvents.DayStyle.BorderStyle.ToString())); rblWeekdayName.SelectedIndex = rblWeekdayName.Items.IndexOf(rblWeekdayName.Items.FindByValue(calEvents.DayNameFormat.ToString())); rblWeekdayTextSize.SelectedIndex = rblWeekdayTextSize.Items.IndexOf(rblWeekdayTextSize.Items.FindByValue(calEvents.DayHeaderStyle.Font.Size.Type.ToString())); ddlTodayColor.SelectedIndex = ddlTodayColor.Items.IndexOf(new ListItem(calEvents.TodayDayStyle.BackColor.Name.ToString())); ddlSelectedDayColor.SelectedIndex = ddlSelectedDayColor.Items.IndexOf(new ListItem(calEvents.SelectedDayStyle.BackColor.Name.ToString())); if (calEvents.NextPrevFormat.Equals(NextPrevFormat.FullMonth)) { chbShowMonths.Checked = true; } else { chbShowMonths.Checked = false; } } catch (SqlException er) { lblWelcome.Text = "Oops, something went wrong. If someone from FINKI comes show them this error number: " + er.Number; } finally { con.Close(); } }
private void Grid_RowDataBound(object sender, GridViewRowEventArgs e) { if (e == null) { return; } if (e.Row.RowType != DataControlRowType.DataRow) { return; } int count = e.Row.Cells.Count; if (count == 0) { return; } File file = (File)e.Row.DataItem; var fileMimeTypeGroups = MimeType.GetGroups(file.Name, true); TableCell fileNameCell; string dateCssClass = "flDate"; if (this.ShowIcons) { fileNameCell = e.Row.Cells[1]; dateCssClass += " flIcons"; e.Row.Cells[0].CssClass = "flFirst " + GetFileTypeIconCssClass(fileMimeTypeGroups); string fontSize = string.Format(CultureInfo.InvariantCulture, "{0}px", (int)this.IconSize); e.Row.Cells[0].Font.Size = FontUnit.Parse(fontSize, CultureInfo.InvariantCulture); e.Row.Cells[0].Style["line-height"] = fontSize; } else { fileNameCell = e.Row.Cells[0]; } HyperLink link = fileNameCell.Controls[0] as HyperLink; if (link == null) { link = fileNameCell.Controls[1] as HyperLink; } if (link != null) { link.Attributes["rel"] = "noopener"; if (this.ShowFileToolTip) { link.CssClass = "flFileName"; if ((fileMimeTypeGroups & MimeTypeGroups.Image) == MimeTypeGroups.Image) { string thumbUrl = this.EnableThumbnails ? this.FileManager.GetThumbnailUrl(file.FileId, 600, 500, 1, true) : file.Url; string content = string.Format(CultureInfo.InvariantCulture, ToolTipBigHtml, file.Url, file.Name, thumbUrl); link.Attributes["data-ot"] = content; } } } DateTime updatedTime = TimeZoneInfo.ConvertTimeFromUtc(file.LastModified, this.TimeZone); DateTime updatedDate = file.LastModified.Date; if (m_UpdatedDate != updatedDate) { if (m_UpdatedDate != DateTime.MinValue) { e.Row.CssClass += " flPt"; } using (HtmlGenericControl panel = new HtmlGenericControl("div")) { panel.InnerHtml = string.Format(this.Culture, this.DateTimeFormatString, updatedTime); panel.Attributes["class"] = dateCssClass; fileNameCell.Controls.AddAt(0, panel); } } m_UpdatedDate = updatedDate; if (this.EnableDeleting && this.EnableDeletingConfirmation) { TableCell deleteCell = e.Row.Cells[count - 1]; if (deleteCell.Controls.Count > 0) { WebControl control = deleteCell.Controls[0] as WebControl; if (control != null) { control.Attributes.Add("onclick", OnDeletingClientScript); control.ToolTip = Resources.FileList_DeleteText; } } } }