コード例 #1
0
        public static void AddHeaderButton(this IHtmlHelper helper,
                                           IHtmlContent content = null,
                                           string function      = null,
                                           string url           = null,
                                           BtnClass btn         = BtnClass.Default,
                                           string icon          = null,
                                           string identifier    = null,
                                           string classes       = null,
                                           string title         = null,
                                           object attr          = null)
        {
            var Provider = helper.GetService <IGeneralHelper>();

            Provider.AddHeaderButton(helper, content, function, url, btn, icon, identifier, classes, title, attr);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: Nofuq/Projects
        private void Form1_Load(object sender, EventArgs e)
        {
            DataSource.OnLogWrite += DataSourceOnOnLogWrite;
            var btns = BtnClass.GetSampleBtn();
            int top  = 0;

            foreach (var myBtn in btns)
            {
                Button b = new Button();
                b.Click += (o, args) =>
                {
                    richTextBox1.Text =
                        DataSource.GetColumn(myBtn.BtnGuid)
                        .Select(a => a.Key + " - " + a.Value)
                        .Aggregate((a1, b1) => a1 += b1 + "\n");
                    dataGridView1.DataSource       = DataSource.GetDataTableType(1, myBtn.BtnGuid, "91.203.70.105:8110", "admin", "resto#test", new DateTime(DateTime.Now.Year, DateTime.Now.Month - 1, 1), new DateTime(DateTime.Now.Year, DateTime.Now.Month - 1, DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month - 1)));
                };
                b.Text = myBtn.BtnName;
                b.Top  = top;
                top   += 25;
                panel1.Controls.Add(b);
            }
        }
コード例 #3
0
 public static string GetButtonClass(BtnClass cls)
 {
     return(RazorConfig.Theme.GetButtonClass(cls));
 }
コード例 #4
0
 public virtual string GetButtonClass(BtnClass type)
 {
     return("btn-" + type.ToString().ToLower());
 }
コード例 #5
0
 public void AddToButtons(IHtmlContent content = null, string function = null, string url = null, BtnClass btn = BtnClass.Default, string icon = null, string identifier = null, string classes = null, string title = null, object attr = null)
 {
     if (url != null)
     {
         url = RazorUtils.ApplyConvension(url, AppParts.Route);
     }
     Buttons.Add(LinkModel.Make(content, function, url, btn, icon, identifier, classes, title, attr));
 }
コード例 #6
0
        public virtual IHtmlContent Button(IHtmlHelper helper, string text, string function, string url, BtnClass btn, string icon, string identifier, IHtmlContent content, string classes, string title, object attr)
        {
            content = content != null ? content : (text == null ? null : helper.Word(text));
            if (url != null)
            {
                url = RazorUtils.ApplyConvension(url, AppParts.Route);
            }
            LinkModel model = LinkModel.Make(content, function, url, btn, icon, identifier, classes, title, attr);

            return(helper.GetComponent("Buttons/Button", model));
        }
コード例 #7
0
 public virtual void AddHeaderButton(IHtmlHelper helper, IHtmlContent content = null, string function = null, string url = null, BtnClass btn = BtnClass.Default, string icon = null, string identifier = null, string classes = null, string title = null, object attr = null)
 {
     if (url != null)
     {
         url = helper.GetService <IUIFileNameService>().ApplyConvension(url, AppParts.Route);
     }
     helper.HeaderModel().AddToButtons(content, function, url, btn, icon, identifier, classes, title, attr);
 }
コード例 #8
0
 public static LinkModel Make(IHtmlContent content = null, string function = null, string url = null, BtnClass btn = CodeShellCore.Web.Razor.BtnClass.Default, string icon = null, string identifier = null, string classes = null, string title = null, object attr = null)
 {
     return(new LinkModel
     {
         Text = content,
         Function = function,
         BtnClassEnum = btn,
         Url = url,
         IconClass = icon,
         Attrs = attr,
         Classes = classes,
         Title = title
     });
 }
コード例 #9
0
 public string GetButtonClass(BtnClass type)
 {
     return(_inner.GetButtonClass(type));
 }
コード例 #10
0
 public override IHtmlContent Button(IHtmlHelper helper, string text, string function, string url, BtnClass btn, string icon, string identifier, IHtmlContent content, string classes, string title, object attr)
 {
     if (identifier != null)
     {
         helper.AddToViewControls(new ControlDTO
         {
             Identifier  = identifier?.ToLower(),
             ControlType = "Button"
         });
         if (!helper.GetAccessibility(identifier?.ToLower()).Read)
         {
             return(null);
         }
     }
     return(base.Button(helper, text, function, url, btn, icon, identifier, content, classes, title, attr));
 }
コード例 #11
0
 public override void AddHeaderButton(IHtmlHelper helper, IHtmlContent content = null, string function = null, string url = null, BtnClass btn = BtnClass.Default, string icon = null, string identifier = null, string classes = null, string title = null, object attr = null)
 {
     if (identifier != null)
     {
         var acc = proc.Process(helper, identifier, "HeaderButton");
         if (!acc.Read)
         {
             return;
         }
     }
     base.AddHeaderButton(helper, content, function, url, btn, icon, identifier, classes, title, attr);
 }
コード例 #12
0
 public static string ButtonClass(this IHtmlHelper helper, BtnClass cls)
 {
     return(RazorUtils.GetButtonClass(cls));
 }