예제 #1
0
 public void AddOption(string text, string action)
 {
     ContextMenuItem item = new ContextMenuItem();
     item.Action = action;
     item.Text = text;
     this.BackingDoodad.AddFile(text, item);
 }
예제 #2
0
        public void AddOption(string text, string action)
        {
            ContextMenuItem item = new ContextMenuItem();

            item.Action = action;
            item.Text   = text;
            this.BackingDoodad.AddFile(text, item);
        }
예제 #3
0
 public static ContextMenuItem FromNode(Node itemNode)
 {
     ContextMenuItem ret = new ContextMenuItem();
     ret.DataID = itemNode.ID.ToString();
     ret.Text = itemNode.Text;
     ret.Action = itemNode.Value;
     return ret;
 }
예제 #4
0
        public static ContextMenuItem FromNode(Node itemNode)
        {
            ContextMenuItem ret = new ContextMenuItem();

            ret.DataID = itemNode.ID.ToString();
            ret.Text   = itemNode.Text;
            ret.Action = itemNode.Value;
            return(ret);
        }
예제 #5
0
        private static HtmlGenericControl CreateContextMenuItem(ContextMenuItem item)
        {
            HtmlGenericControl li = ControlHelper.CreateControl("li", "");
            HtmlGenericControl a  = ControlHelper.CreateControl("a", item.Text);

            a.Attributes.Add("href", "#" + item.Action);
            li.Controls.Add(a);
            return(li);
        }
예제 #6
0
 private static ContextMenuItem[] ToContextMenuItems(string value)
 {
     return(value.Split <ContextMenuItem>(";", (item) =>
     {
         ContextMenuItem ctxItem = item.ToObject <ContextMenuItem>((c) =>
         {
             string[] values = c.Split(':');
             Expect.IsTrue(values.Length == 2, "Invalid ContextMenuItem string specified.");
             return new ContextMenuItem(values[1], values[0]);
         });
         return ctxItem;
     }));
 }
예제 #7
0
        public override void WireScriptsAndValidate()
        {
            this.controlToRender.TagName = "div";
            this.controlToRender.Attributes.Add("class", "contextMenu");
            this.controlToRender.Style.Add("display", "none");
            this.controlToRender.Attributes.Add("jsonid", this.jsonId);
            this.controlToRender.Attributes.Add("id", this.DomId);

            this.controlToRender.Controls.Add(new LiteralControl("This control is not complete.  It still needs client side wiring and the jQuery contextMenu plugin isn't quite approprate here."));

            WriteDefaultTemplateToDisk(typeof(ContextMenuItem));

            foreach (Node file in this.BackingDoodad.Files)
            {
                ContextMenuItem item = ContextMenuItem.FromNode(file);
                this.controlToRender.Controls.Add(new LiteralControl(BoxServer.GetTemplatedString(item, this.TemplateName)));
            }
        }
예제 #8
0
 private static HtmlGenericControl CreateContextMenuItem(ContextMenuItem item)
 {
     HtmlGenericControl li = ControlHelper.CreateControl("li", "");
     HtmlGenericControl a = ControlHelper.CreateControl("a", item.Text);
     a.Attributes.Add("href", "#" + item.Action);
     li.Controls.Add(a);
     return li;
 }