void Initialize() { this.Text = "Untitled menu"; _childs = new MenuTreeNodes(); ControlStyle.Width = new Unit(100); ControlStyle.Height = new Unit(20); }
/// <summary> /// Retrieves a string representing the current menu array /// </summary> /// <param name="prefix"></param> /// <param name="mn"></param> /// <returns>The current menu array</returns> public string ToMenuArray(string prefix, MenuTreeNodes mn) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < mn.Count; i++) { sb.Append(prefix); sb.Append(i + 1); sb.Append(mn[i].ToMenuArray()); sb.Append(ToMenuArray(prefix + (i + 1).ToString() + "_", mn[i].Childs)); } return(sb.ToString()); }
void Initialize() { _childs = new MenuTreeNodes(); _controlItemStyle = new Style(); _controlSubStyle = new Style(); _controlHiStyle = new Style(); _controlHiSubStyle = new Style(); CssClass = ""; _controlItemStyle.CssClass = ""; _controlSubStyle.CssClass = ""; _controlHiStyle.CssClass = ""; _controlHiSubStyle.CssClass = ""; BackColor = Color.White; _controlItemStyle.BackColor = Color.White; _controlSubStyle.BackColor = Color.White; _controlHiStyle.BackColor = Color.Black; _controlHiSubStyle.BackColor = Color.Black; ForeColor = Color.Black; _controlItemStyle.ForeColor = Color.Black; _controlSubStyle.ForeColor = Color.Black; _controlHiStyle.ForeColor = Color.White; _controlHiSubStyle.ForeColor = Color.White; BorderColor = Color.Black; _controlItemStyle.BorderColor = Color.Black; _controlSubStyle.BorderColor = Color.Black; BorderWidth = new Unit(1); ControlStyle.Width = new Unit(100); ControlStyle.Height = new Unit(20); Font.Names = new string[2] { "Arial", "sans-serif" }; Font.Size = new FontUnit(9); Font.Bold = true; Font.Italic = false; _arrws = new System.Web.UI.WebControls.Image[3]; _arrws[0] = new System.Web.UI.WebControls.Image(); _arrws[0].ImageUrl = "tri.gif"; _arrws[0].Width = 5; _arrws[0].Height = 10; _arrws[1] = new System.Web.UI.WebControls.Image(); _arrws[1].ImageUrl = "tridown.gif"; _arrws[1].Width = 10; _arrws[1].Height = 5; _arrws[2] = new System.Web.UI.WebControls.Image(); _arrws[2].ImageUrl = "trileft.gif"; _arrws[2].Width = 5; _arrws[2].Height = 10; }
/// <summary> /// Retrieves a string representing the current menu array /// </summary> /// <param name="prefix"></param> /// <param name="mn"></param> /// <returns>The current menu array</returns> public string ToMenuArray(string prefix, MenuTreeNodes mn) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < mn.Count; i++) { sb.Append(prefix); sb.Append(i + 1); sb.Append(mn[i].ToMenuArray()); sb.Append(ToMenuArray(prefix + (i + 1).ToString() + "_", mn[i].Childs)); } return sb.ToString(); }