Beispiel #1
0
        private static GroupBox MakeGroupBox(string title, CheckBoxProperty checkBoxs)
        {
            var flowLayout = new FlowLayoutPanel();

            flowLayout.WrapContents = true;
            flowLayout.Dock         = DockStyle.Fill;
            flowLayout.AutoSize     = true;
            flowLayout.AutoSizeMode = AutoSizeMode.GrowAndShrink;

            flowLayout.Controls.Add(AddSelectAllCheckBox());

            foreach (var content in checkBoxs.Keys)
            {
                flowLayout.Controls.Add(MakeCheckBox(content, checkBoxs[content]));
            }

            var groupBox = new GroupBox();

            groupBox.Dock    = DockStyle.Top;
            groupBox.Text    = title;
            groupBox.Resize += new System.EventHandler(GroupBoxResize);
            groupBox.Controls.Add(flowLayout);

            return(groupBox);
        }
 private void ReadJurisdictionRelationShip()
 {
     foreach (var c in TypesOfServerClass)
     {
         foreach (var m in c.GetMethods())
         {
             var find = false;
             foreach (var a in m.GetCustomAttributes(false))
             {
                 if (find)
                 {
                     continue;
                 }
                 if (a is JurisdictionAttribute)
                 {
                     find = true;
                     var p = a as JurisdictionAttribute;
                     if (!JurisdictionRelationShip.Keys.Contains(p.TabName))
                     {
                         var checkbox = new CheckBoxProperty();
                         checkbox[p.Description] = p.JurisdictionID;
                         var groupbox = new GroupBoxProperty();
                         groupbox[p.GroupBoxName]            = checkbox;
                         JurisdictionRelationShip[p.TabName] = groupbox;
                     }
                     else
                     {
                         if (!JurisdictionRelationShip[p.TabName].Keys.Contains(p.GroupBoxName))
                         {
                             var checkbox = new CheckBoxProperty();
                             checkbox[p.Description] = p.JurisdictionID;
                             JurisdictionRelationShip[p.TabName][p.GroupBoxName] = checkbox;
                         }
                         else
                         {
                             if (!JurisdictionRelationShip[p.TabName][p.GroupBoxName].Keys.Contains(p.Description))
                             {
                                 JurisdictionRelationShip[p.TabName][p.GroupBoxName][p.Description] = p.JurisdictionID;
                             }
                             else
                             {
                                 System.Console.WriteLine(m.Name + "服务ID设置重复!");
                             }
                         }
                     }
                 }
             }
         }
     }
 }
        private CheckBoxProperty AddConvexControl(bool?convex)
        {
            var convexControl = new CheckBoxProperty();

            convexControl.PropertyName = "Convex";
            panel.Controls.Add(convexControl);

            if (convex.HasValue)
            {
                convexControl.PropertyValue = convex.Value;
            }

            return(convexControl);
        }