当前位置: 首页>>代码示例>>C#>>正文


C# BindingList.Add方法代码示例

本文整理汇总了C#中BindingList.Add方法的典型用法代码示例。如果您正苦于以下问题:C# BindingList.Add方法的具体用法?C# BindingList.Add怎么用?C# BindingList.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BindingList的用法示例。


在下文中一共展示了BindingList.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: updateListBox

        //Input data into the list box
        public void updateListBox()
        {
            objectsInScene = new BindingList<object>();

            //Gets all objects from the input panel
            pointsInScene = getPoints();
            linesInScene = getLines();
            anglesInScene = getAngles();

            //Adds each object to one Binding List
            foreach (Point p in pointsInScene)
            {
                objectsInScene.Add(p);
            }
            foreach (Line l in linesInScene)
            {
                objectsInScene.Add(l);
            }
            foreach (Angle a in anglesInScene)
            {
                objectsInScene.Add(a);
            }

            //Converts the Binding List to appropriate strings, and puts this data in the list for the user
            objectListBox.DataSource = convertToString(objectsInScene);
        }
开发者ID:louisdeb,项目名称:OpenGL-3D-Vectors,代码行数:27,代码来源:ObjectInspectorPanel.cs

示例2: GenerateHardCodedEmployees

        public static BindingList<Employee> GenerateHardCodedEmployees ()
        {
            Employee em1 = new Employee("Jari", "Korppunen");
            em1.EmployeeId = 1;
            em1.SocialID = "120467-872J";
            em1.Title = "Toimitusjohtaja";
            em1.Salary = 4650;
            em1.ContractType = (int)Employee.ContractTypes.Permanent;
            em1.DateOfBirth = new DateTime(1967, 4, 12);
            em1.DateOfWorkStarted = new DateTime(1993, 2, 19);

            Employee em2 = new Employee("Eino", "Leino");
            em2.EmployeeId = 2;
            em2.SocialID = "01021920-852A";
            em2.Title = "Apulaissihteerin sijainen";
            em2.Salary = 1200;
            em2.ContractType = (int)Employee.ContractTypes.Permanent;
            em2.DateOfBirth = new DateTime(1920, 2, 1);
            em2.DateOfWorkStarted = new DateTime(1999, 2, 2);

            Employee em3 = new Employee("Kalervo", "Kullervo");
            em3.SocialID = "051293-1238";
            em3.EmployeeId = 3;
            em3.ContractType = (int)Employee.ContractTypes.PartTime;
            em3.DateOfBirth = new DateTime(1993, 12, 5);
            em3.DateOfWorkStarted = new DateTime(2014, 2, 9);

            BindingList<Employee> em = new BindingList<Employee>();
            em.Add(em1);
            em.Add(em2);
            em.Add(em3);

            return em;
        }
开发者ID:tarvainen,项目名称:IIO11300,代码行数:34,代码来源:DBCompany.cs

示例3: TestDataBindingSubList

 public void TestDataBindingSubList()
 {
     var boundDataGridView = new BoundDataGridView
                                 {
                                     BindingContext = new BindingContext(),
                                     DataSource = new BindingListSource(),
                                 };
     using (boundDataGridView)
     {
         var columnIds = new[]
                             {
                                 PropertyPath.Root,
                                 PropertyPath.Parse("Sequence"),
                                 PropertyPath.Parse("AminoAcidsList!*.Code"),
                                 PropertyPath.Parse("Molecule!*"),
                             };
         var viewSpec = new ViewSpec()
             .SetColumns(columnIds.Select(id => new ColumnSpec().SetPropertyPath(id)))
             .SetSublistId(PropertyPath.Parse("AminoAcidsList!*"));
         var viewInfo = new ViewInfo(new DataSchema(), typeof (LinkValue<Peptide>), viewSpec);
         // ReSharper disable once UseObjectOrCollectionInitializer
         var innerList = new BindingList<LinkValue<Peptide>>();
         innerList.Add(new LinkValue<Peptide>(new Peptide("AD"), null));
         ((BindingListSource)boundDataGridView.DataSource).SetViewContext(new TestViewContext(viewInfo.DataSchema, new[]{new RowSourceInfo(innerList, viewInfo)}));
         Assert.AreEqual(2, boundDataGridView.Rows.Count);
         innerList.Add(new LinkValue<Peptide>(new Peptide("TISE"), null));
         Assert.AreEqual(6, boundDataGridView.Rows.Count);
     }
 }
开发者ID:lgatto,项目名称:proteowizard,代码行数:29,代码来源:BoundDataGridViewTest.cs

示例4: AssembleWorkPegging

        public IList<Material> AssembleWorkPegging()
        {
            IList<Material> MH = new BindingList<Material>();
            Material mh = new Material();
            Material mh1 = new Material();
            Material mh2 = new Material();

            //mh.name = "汽车";
            //mh.number = "1200";
            //mh.type = "21";
            //mh.versions = "";
            //mh.status = "";

            //mh1.name = "飞机";
            //mh1.number = "2200";
            //mh1.type = "213";
            //mh1.versions = "";
            //mh1.status = "";

            //mh2.name = "轮船";
            //mh2.number = "3200";
            //mh2.type = "211";
            //mh2.versions = "";
            //mh2.status = "";

            MH.Add(mh);
            MH.Add(mh1);
            MH.Add(mh2);
            return MH;
        }
开发者ID:gofixiao,项目名称:HYPDM_Pro,代码行数:30,代码来源:MaterialPegging.cs

示例5: MealTime_Load

 private void MealTime_Load(object sender, EventArgs e)
 {
     try
     {
         if (Equals(null, _controller))
         {
             foreach (Control control in this.Controls)
             {
                 if (0 != String.Compare(control.Text, "Cancel", false))
                     control.Enabled = false;
             }
             return;
         }
         BindingList<Nom> noms = new BindingList<Nom>();
         if (_meal.MyCat.DietIsRestricted)
         {
             foreach (Nom nom in _meal.MyCat.NomsAsList)
                 noms.Add(nom);
             _selectNom.DropDownStyle = ComboBoxStyle.DropDownList;
         }
         else
         {
             foreach (Nom nom in _controller.GetNoms())
                 noms.Add(nom);
             _selectNom.DropDownStyle = ComboBoxStyle.DropDown;
         }
         _selectNom.DataSource = noms;
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
         Debug.WriteLine(ex.StackTrace);
     }
 }
开发者ID:ssdug,项目名称:2013-April-Florey,代码行数:34,代码来源:MealTime.cs

示例6: AP

        public IList<Material> AP()
        {
            IList<Material> Me = new BindingList<Material>();
            Material me = new Material();
            Material me1 = new Material();
            Material me2 = new Material();

            //me.name = "孙悟空";
            //me.number = "1101";
            //me.type = "异种";
            //me.versions = "老大";

            //me1.name = "猪八戒";
            //me1.number = "1201";
            //me1.type = "元帅";
            //me1.versions = "老二";

            //me2.name = "沙和尚";
            //me2.number = "1302";
            //me2.type = "将军";
            //me2.versions = "老三";

            Me.Add(me);
            Me.Add(me1);
            Me.Add(me2);
            return Me;
        }
开发者ID:gofixiao,项目名称:HYPDM_Pro,代码行数:27,代码来源:MaterialPegging.cs

示例7: CreateData

 BindingList<PersonRegistration> CreateData()
 {
     BindingList<PersonRegistration> res = new BindingList<PersonRegistration>();
         res.Add(AddPersonRegistration(res.Count + 1, "Andrew", "Fuller", 42, "[email protected]", DateTime.Today.AddDays(-32)));
         res.Add(AddPersonRegistration(res.Count + 1, "Nancy", "Davolio", 34, "[email protected]", DateTime.Today.AddDays(4)));
         res.Add(AddPersonRegistration(res.Count + 1, "Margaret", "Peackop", 48, "margaret.peackop.devexpress.com", DateTime.Today.AddDays(6)));
         res.Add(AddPersonRegistration(res.Count + 1, "Robert", "K", 29, "[email protected]", DateTime.Today.AddDays(5)));
         res.Add(AddPersonRegistration(res.Count + 1, "Anne", "Dodsworth", 17, "[email protected]", DateTime.Today.AddDays(4)));
         return res;
 }
开发者ID:giangpc9x,项目名称:quanlygtproject,代码行数:10,代码来源:DemoValidationClass.cs

示例8: TestSuiteState

 public TestSuiteState()
 {
     Variables = new BindingList<string>();
     ConnectionStringNames = new BindingList<string>();
     TestCases = new DataTable();
     Tests = new LargeBindingList<Test>();
     Settings = new BindingList<Setting>();
     Settings.Add(new Setting() { Name = "Default - System-under-test" });
     Settings.Add(new Setting() { Name = "Default - Assert" });
 }
开发者ID:Waltervondehans,项目名称:NBi,代码行数:10,代码来源:TestSuiteState.cs

示例9: GetGioiTinh

        public static BindingList<ComboboxData> GetGioiTinh()
        {
            BindingList<ComboboxData> ls = new BindingList<ComboboxData>();
            ComboboxData data1 = new ComboboxData("Nam", "1");
            ComboboxData data2 = new ComboboxData("Nữ", "0");

            ls.Add(data1);
            ls.Add(data2);
            return ls;
        }
开发者ID:itcthienkhiem,项目名称:DienLucHocMonCT,代码行数:10,代码来源:Util.cs

示例10: SqlLoginPage

 public SqlLoginPage()
 {
     InitializeComponent();
     BindingList<AutheticationMapper> autheticationmapper = new BindingList<AutheticationMapper>();
     autheticationmapper.Add(new AutheticationMapper("Window Authentication", 1));
     autheticationmapper.Add(new AutheticationMapper("SQL Server Authentication", 2));
     drpAuthenticationType.DataSource = autheticationmapper;
     drpAuthenticationType.DisplayMember = "AuthType";
     drpAuthenticationType.ValueMember = "ID";
 }
开发者ID:sandipmalaviya07,项目名称:MVCTierGenerator,代码行数:10,代码来源:SqlLoginPage.cs

示例11: GetCustomers

        private BindingList<Customer> GetCustomers()
        {
            BindingList<Customer> customers = new BindingList<Customer>();
            customers.Add(new Customer("David"));
            customers.Add(new Customer("Andrew"));
            customers.Add(new Customer("Bob"));
            customers.Add(new Customer("Chris"));

            return customers;
        }
开发者ID:Kolenov,项目名称:BindingListView,代码行数:10,代码来源:Form1.cs

示例12: BondStructureFwdAnalysis

    public BondStructureFwdAnalysis(BondStructure structure_)
    {
      m_asOfAte = CarbonHistoricRetriever.GetDateForward(DateTime.Today, -1);
      m_fwdDate = CarbonHistoricRetriever.GetDateForward(AsOfSettleDate, 1, Symmetry.Carbon.Model.DateUnit.M);
      m_structure = structure_;

      Lines = new BindingList<BondStructureFwdAnalysisLine>();
      foreach (var v in structure_.Components)
        Lines.Add(new BondStructureFwdAnalysisLine(this,v));
      Lines.Add(CombinedLine= new BondStructureFwdAnalysisLine("Combined"));

    }
开发者ID:heimanhon,项目名称:researchwork,代码行数:12,代码来源:BondStructureFwdAnalysis.cs

示例13: GetKhuVucSong

        public static BindingList<ComboboxData> GetKhuVucSong()
        {
            BindingList<ComboboxData> ls = new BindingList<ComboboxData>();
            ComboboxData data1 = new ComboboxData("K1", "K1");
            ComboboxData data2 = new ComboboxData("K2", "K2");
            ComboboxData data3 = new ComboboxData("K3", "K3");

            ls.Add(data1);
            ls.Add(data2);
            ls.Add(data3);
            return ls;
        }
开发者ID:itcthienkhiem,项目名称:DienLucHocMonCT,代码行数:12,代码来源:Util.cs

示例14: findRelatedOperation

 public IList<Operation> findRelatedOperation(int roleId)
 {
     IList<Operation> list = new BindingList<Operation>();
     Operation operation = new Operation();
     operation.Id = 1;
     operation.Name = "删除";
     Operation operation1 = new Operation();
     operation1.Id = 1;
     operation1.Name = "添加";
     list.Add(operation);
     list.Add(operation1);
     return list;
 }
开发者ID:gofixiao,项目名称:HYPDM_Pro,代码行数:13,代码来源:RoleManage.cs

示例15: findRelatedMenu

 public IList<Menus> findRelatedMenu(int roleId)
 {
     IList<Menus> list = new BindingList<Menus>();
     Menus menu = new Menus();
     menu.Id = 1;
     menu.Name = "系统管理工具";
     Menus menu1 = new Menus();
     menu1.Id = 2;
     menu1.Name = "项目管理";
     list.Add(menu);
     list.Add(menu1);
     return list;
 }
开发者ID:gofixiao,项目名称:HYPDM_Pro,代码行数:13,代码来源:RoleManage.cs


注:本文中的BindingList.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。