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


C# BindingSource.Add方法代码示例

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


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

示例1: ObjectsBusy_BindingSource

 public BindingSource ObjectsBusy_BindingSource()
 {
     BindingSource bs = new BindingSource();
     for (int i = 0; i < objects_busy_numbers.Count; i++)
         bs.Add(new Rectangle { Pole = objects_busy_points[i].Copy, Vector = objects_sizes[objects_busy_numbers[i]].Copy });
     return bs;
 }
开发者ID:Ring-r,项目名称:opt,代码行数:7,代码来源:Placement.cs

示例2: clientIdComboBox_SelectedIndexChanged

 private void clientIdComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     BindingSource clientBS = new BindingSource();
     clientBS.Add(clientLogic.GetClientByID( (int) clientIdComboBox.SelectedValue));
     showClient.DataSource = clientBS;
     refreshOrderBindings();
 }
开发者ID:ErickMC,项目名称:Llama,代码行数:7,代码来源:SalesForm.cs

示例3: Objects_BindingSource

 public BindingSource Objects_BindingSource()
 {
     BindingSource bs = new BindingSource();
     for (int i = 0; i < sort.Count; i++)
         bs.Add(objects_sizes[sort[i]]);
     return bs;
 }
开发者ID:Ring-r,项目名称:opt,代码行数:7,代码来源:Placement.cs

示例4: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            //NavigateDirs nav = new NavigateDirs();

            nav.WalkDirectoryTree(di, FileTypes.FileExtensions.mp3);
            MusicFiles mList = nav.MusicFileList;
            BindingSource bindingSource = new BindingSource();

            foreach (MusicFile f in mList)
            {
                bindingSource.Add(f);
            }
            songGrid.AutoSize = true;
            songGrid.AutoResizeColumns();

            //Add checkbox Column
            DataGridViewColumn column = new DataGridViewCheckBoxColumn();
            column.DataPropertyName = "Copy";
            column.Name = "Copy Song";

            songGrid.Columns.Add(column);
            songGrid.Columns["songFormat"].Visible = false;
            songGrid.Columns["songLocation"].Visible = false;

            songGrid.DataSource = bindingSource;
        }
开发者ID:ergoe,项目名称:MusicWizard,代码行数:26,代码来源:Form1.cs

示例5: AddData

 private void AddData(string sPathEn, string sPathVi)
 {
     try
     {
         string[] filePathEn = Directory.GetFiles(sPathEn, "*.ini");
         string[] filePathVi = Directory.GetFiles(sPathVi, "*.ini");
         var bindingSource = new BindingSource();
         data = new List<SimpleDataFile>();
         for (int i = 0; i < filePathEn.Length; i++)
         {
             string[] aPathVi = filePathVi.Where(w => (Path.GetFileName(w).Remove(0, 6) == Path.GetFileName(filePathEn[i]).Remove(0, 6))).ToArray();
             string pathvi = "";
             string Tenfilevi = "";
             if (aPathVi.Length > 0)
             {
                 pathvi = aPathVi[0];
                 Tenfilevi = Path.GetFileName(aPathVi[0]);
                 keyLang = Tenfilevi.Split('.')[0];
             }
             bindingSource.Add(new SimpleDataFile { Chon = false, TenFileEn = Path.GetFileName(filePathEn[i]), TenFileVi = Tenfilevi, PathEn = filePathEn[i], PathVi = pathvi });
             data.Add(new SimpleDataFile { Chon = false, TenFileEn = Path.GetFileName(filePathEn[i]), TenFileVi = Tenfilevi, PathEn = filePathEn[i], PathVi = pathvi });
         }
         gvEn.DataSource = bindingSource;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Có lỗi xảy ra khi load dữ liệu");
     }
 }
开发者ID:huynhduy1985,项目名称:Joomla-translator,代码行数:29,代码来源:TranslatorJoomla.cs

示例6: Form1_Load

        private void Form1_Load(object sender, EventArgs e)
        {
            viewPorts = new BindingSource();
            windows = new BindingSource();
            viewPorts.DataSource = typeof(ViewPort);
            windows.DataSource = typeof(ViewPortForm);

            if (File.Exists(configFile))
            {
                loadedCfg = Helpers.LoadConfig(configFile);
                viewPorts.DataSource = (BindingList<ViewPort>)loadedCfg.ViewPorts;

            }
            else
            {// should move this to helper
                MessageBox.Show(configFile + " not found! Please create a config File", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1
                   , MessageBoxOptions.ServiceNotification);
                this.Close();
            }

            foreach (ViewPort vp in viewPorts)
            {
                ViewPortForm vpWindow = new ViewPortForm(vp);
                vpWindow.Size = new Size(vp.SizeX, vp.SizeY);
                vpWindow.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
                vpWindow.Text = vp.Name;
                vpWindow.Show();
                vpWindow.DesktopLocation = new Point(vp.ScreenPositionX, vp.ScreenPositionY);
                windows.Add(vpWindow);
            }

        }
开发者ID:danvac,项目名称:hogkeys.iris,代码行数:32,代码来源:IrisClient.cs

示例7: vincula

 public BindingSource vincula(string itemCB)
 {
     eventoAplicacao evento = new eventoAplicacao();
     BindingSource novoEvento = new BindingSource();
     novoEvento.Add(evento.selectDTWhere(itemCB));
     return novoEvento;
 }
开发者ID:mateusrdgs,项目名称:semanaTec,代码行数:7,代码来源:vinculaObjeto.cs

示例8: bTranslate_Click

 private void bTranslate_Click(object sender, EventArgs e)
 {
     Translator t = new Translator();
     var bindingSource = new BindingSource();
     pBar.Maximum = obj.List.Count;
     pBar.Value = 1;
     pBar.Step = 1;
     for (int i = 0; i < obj.List.Count; i++)
     {
         SimpleData temp = (SimpleData)obj.List[i];
         if (chkIsEmpty.Checked && temp.Vi == string.Empty)
         {
             temp = TranslateLang(t, temp);
             temp.Chon = true;
         }
         else if(chkFull.Checked)
         {
             temp = TranslateLang(t, temp);
         }
         bindingSource.Add(temp);
         pBar.PerformStep();
         pBar.Update();
     }
     gvData.DataSource = bindingSource;
     obj = bindingSource;
     gvData.Update();
 }
开发者ID:huynhduy1985,项目名称:Joomla-translator,代码行数:27,代码来源:TranslatorOne.cs

示例9: ObjectsFree_BindingSource

 public BindingSource ObjectsFree_BindingSource()
 {
     BindingSource bs = new BindingSource();
     for (int i = 0; i < objects_free_numbers.Count; i++)
         bs.Add(objects_sizes[objects_free_numbers[i]]);
     return bs;
 }
开发者ID:Ring-r,项目名称:opt,代码行数:7,代码来源:Placement.cs

示例10: PlayersForm

        /// <summary>
        /// Constructs the PlayersForm from a PlayerList
        /// </summary>
        /// <param name="list">contains a list of the players</param>
        public PlayersForm(PlayerList list)
        {
            InitializeComponent();
            playerList = list;
            source = new BindingSource();

            // Because PlayerComponents do not encapsulate all of their data within fields, we must adapt them to
            // do so that the UI can bind itself to the data source.
            // The adapter merely places all of the relevant data in fields, and allows us to change the player list before
            // commiting the changes to the actual player list.
            foreach (PlayerComponent player in list.GetChildren())
            {
                PlayerDataGridAdapter adapter = new PlayerDataGridAdapter(player, playerList);
                source.Add(adapter);
            }

            // Initialize Player List to bind data properly.
            uiPlayerList.AutoGenerateColumns = false;
            uiPlayerList.AutoSize = true;
            uiPlayerList.DataSource = source;

            name.DataPropertyName = "Player_Name";
            race.DataPropertyName = "RaceMember";
            gold.DataPropertyName = "GoldMember";
            wood.DataPropertyName = "WoodMember";
            metal.DataPropertyName = "MetalMember";
        }
开发者ID:BGCX261,项目名称:zombie-real-time-strategy-game-svn-to-git,代码行数:31,代码来源:PlayersForm.cs

示例11: RefreshTable

 private void RefreshTable()
 {
     var paymentRequirements = _paymentRequirementService.GetAll();
     _paymentRequirementBindingSource = new BindingSource();
     paymentRequirements.ForEach(insurance => _paymentRequirementBindingSource.Add(insurance));
     paymentRequirementDataGridView.AutoGenerateColumns = true;
     paymentRequirementDataGridView.DataSource = _paymentRequirementBindingSource;
     paymentRequirementDataGridView.ReadOnly = true;
 }
开发者ID:cortwave,项目名称:PolisCompany,代码行数:9,代码来源:PaymentRequirementTableControl.cs

示例12: RefreshTable

 private void RefreshTable()
 {
     var insuranceCategories = _insuranceCategoryService.GetAll();
     _insuranceCategoryBindingSource = new BindingSource();
     insuranceCategories.ForEach(insuranceCase => _insuranceCategoryBindingSource.Add(insuranceCase));
     categoriesDataGridView.AutoGenerateColumns = true;
     categoriesDataGridView.DataSource = _insuranceCategoryBindingSource;
     categoriesDataGridView.ReadOnly = true;
 }
开发者ID:cortwave,项目名称:PolisCompany,代码行数:9,代码来源:InsuranceCategoryControl.cs

示例13: CreateBindingSource

 private static BindingSource CreateBindingSource(IEnumerable<Session> sessions)
 {
     var bindingSource = new BindingSource();
       foreach(var s in sessions)
       {
     bindingSource.Add(s);
       }
       return bindingSource;
 }
开发者ID:romanbdev,项目名称:quickroute-gps,代码行数:9,代码来源:AddSessionsForm.cs

示例14: DataGridView_Load

 private void DataGridView_Load(object sender, EventArgs e)
 {
     var dataSource = new BindingSource();
     foreach (var person in Builder<Person>.CreateListOfSize(50).Build())
     {
         dataSource.Add(person);
     }
     dataGridView1.AutoGenerateColumns = true;
     dataGridView1.DataSource = dataSource;
 }
开发者ID:hbqy90,项目名称:RAutomation,代码行数:10,代码来源:DataGridView.cs

示例15: SetResults

        public void SetResults(List<AllocationResult> results)
        {
            var bs = new BindingSource();

            foreach (var result in results)
            {
                bs.Add(result);
            }

            this.dataGridView1.DataSource = bs;
        }
开发者ID:TomMonks,项目名称:HomeVisitTravelAnalyser,代码行数:11,代码来源:AllocationResultsPanel.cs


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