• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# BindingList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BindingList的典型用法代码示例。如果您正苦于以下问题:C# BindingList类的具体用法?C# BindingList怎么用?C# BindingList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: InitTabControlPages

        private void InitTabControlPages()
        {
            foreach(var obj in CardLevels)
            {
                var page = new TabPage { Text = CardLevel.RoleCardLevelName(obj) };
                CardTabControl.TabPages.Add(page);

                var listData        = new BindingList<RoleCard>();
                var list            = new ListBox()
                {
                    Dock                = DockStyle.Fill,
                    ContextMenuStrip    = TabControlContextMenu,
                    DisplayMember       = "Name",
                    ValueMember         = "Id",
                    DataSource          = listData,
                };
                
                list.SelectedIndexChanged += (sender, msg) =>
                {
                    var item = list.SelectedItem as RoleCard;
                    if (ListOfRoleCardList[CardTabControl.SelectedIndex].Contains(item))
                    {
                        SelectedItem = item;

                        cardInfoControl1.BeginModify();
                        cardInfoControl1.Images     = CardImageDictionary[SelectedItem.Id];
                        cardInfoControl1.RoleCard   = SelectedItem;
                        cardInfoControl1.EndModify();
                    }
                };

                page.Controls.Add(list);
                ListOfRoleCardList.Add(listData);
            }
        }
开发者ID:xxy1991,项目名称:cozy,代码行数:35,代码来源:EditorForm.cs


示例2: CalcPurchOrderLine

        private BindingList<PurchOrder_Receive> CalcPurchOrderLine(Session session)
        {
            BindingList<PurchOrder_Receive> poReceives = new BindingList<PurchOrder_Receive>();

            XPClassInfo poLineClass;
            CriteriaOperator criteria;
            SortingCollection sortProps;
            StringBuilder sbCriteria = new StringBuilder();

            sbCriteria.Append(string.Format("OrderStatus = '{0}'", PurchOrderLine.PurchOrderStatus.Active));

            if (txtItemNo.Text != "")
                sbCriteria.Append(string.Format(" AND Item.ItemNo = '{0}'", txtItemNo.Text));

            if (txtVendor.Text != "")
                sbCriteria.Append(string.Format(" AND Vendor.No = '{0}'", txtVendor.Text));

            poLineClass = session.GetClassInfo(typeof(PurchOrderLine));
            criteria = CriteriaOperator.Parse(sbCriteria.ToString());
            sortProps = new SortingCollection(null);

            ICollection poLines = session.GetObjects(poLineClass, criteria, sortProps, int.MaxValue, false, true);

            foreach (PurchOrderLine poLine in poLines)
            {
                PurchOrder_Receive poReceive = new PurchOrder_Receive();
                poReceive.PurchOrderLine = poLine;
                poReceive.Item = poLine.Item;
                poReceive.ItemType = poLine.Item.ItemType;
                poReceive.ReceivedWarehouse = poLine.Warehouse;
                poReceives.Add(poReceive);
            }

            return poReceives;
        }
开发者ID:kamchung322,项目名称:Namwah,代码行数:35,代码来源:frmMpPurchOrderReceive.cs


示例3: RealGridsManagerWindow

 public RealGridsManagerWindow()
 {
     InitializeComponent();
     _savedList = new List<RealGridData>();
     _gridsList = new BindingList<RealGridData>();
     _gridListView.ItemsSource = _gridsList;
 }
开发者ID:KFlaga,项目名称:Cam3D,代码行数:7,代码来源:RealGridsManagerWindow.xaml.cs


示例4: MakeMaterialsPage

		private void MakeMaterialsPage()
			{
			Materials = new BindingList<MaterialDataBinder>();
			foreach( MaterialData material in Application.OpenedProject.Materials )
				Materials.Add( new MaterialDataBinder( new MaterialData( material ) ) );
			listBoxMedium.DataSource = Materials;
			}
开发者ID:DaishiNakase,项目名称:WaveguideDesigner,代码行数:7,代码来源:MaterialSystemEditorDialog.cs


示例5: MovieSetManager

        /// <summary>
        /// Initializes static members of the <see cref="MovieSetManager"/> class.
        /// </summary>
        static MovieSetManager()
        {
            database = new BindingList<MovieSetModel>();
            currentSet = new MovieSetModel();

            database.ListChanged += Database_ListChanged;
        }
开发者ID:Acrisius,项目名称:YANFOE.v2,代码行数:10,代码来源:MovieSetManager.cs


示例6: VirtualListVewModel

        public VirtualListVewModel(SynchronizationContext bindingContext, DataService service)
        {
            _virtualRequest = new BehaviorSubject<VirtualRequest>(new VirtualRequest(0,10));

            Items = new BindingList<Poco>();

            var sharedDataSource = service
                .DataStream
                .Do(x => Trace.WriteLine($"Service -> {x}"))
                .ToObservableChangeSet()
                .Publish();

            var binding = sharedDataSource
                          .Virtualise(_virtualRequest)
                          .ObserveOn(bindingContext)
                          .Bind(Items)
                          .Subscribe();
            
            //the problem was because Virtualise should fire a noticiation if count changes, but it does not [BUG]
            //Therefore take the total count from the underlying data NB: Count is DD.Count() not Observable.Count()
            Count = sharedDataSource.Count().DistinctUntilChanged();

            Count.Subscribe(x => Trace.WriteLine($"Count = {x}"));

            var connection = sharedDataSource.Connect();
            _disposables = new CompositeDisposable(binding, connection);
        }
开发者ID:RolandPheasant,项目名称:Test-Dynamic-Data,代码行数:27,代码来源:VirtualListVewModel.cs


示例7: DomainFacade

 private DomainFacade(IPlugin pPlugin)
 {
     cPlugin = pPlugin;
       cObserverList = new List<IObserver>();
       cRecordList = new BindingList<DNSPoisonRecord>();
       cInfrastructure = InfrastructureFacade.getInstance(pPlugin);
 }
开发者ID:vaginessa,项目名称:Simsang,代码行数:7,代码来源:DomainFacade.cs


示例8: AddMappingDialog

        public AddMappingDialog(BindingList<KeyMapping> mappings, ClassDefinition acls, ClassDefinition rcls)
            : this()
        {
            _mappings = mappings;

            lblClass.Text = rcls.QualifiedName;
            lblAssocClass.Text = acls.QualifiedName;

            List<DataPropertyDefinition> aprops = new List<DataPropertyDefinition>();
            List<DataPropertyDefinition> rprops = new List<DataPropertyDefinition>();

            foreach (PropertyDefinition p in acls.Properties)
            {
                if (p.PropertyType == PropertyType.PropertyType_DataProperty)
                    aprops.Add((DataPropertyDefinition)p);
            }

            foreach (PropertyDefinition p in rcls.Properties)
            {
                if (p.PropertyType == PropertyType.PropertyType_DataProperty)
                    rprops.Add((DataPropertyDefinition)p);
            }

            cmbActiveProperty.DataSource = rprops;
            cmbAssociatedProperty.DataSource = aprops;

            cmbActiveProperty.SelectedIndex = 0;
            cmbAssociatedProperty.SelectedIndex = 0;
        }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:29,代码来源:AddMappingDialog.cs


示例9: DeserializeFromXml

        public static void DeserializeFromXml(string xml)
        {
            //When there is nothing to deserialize, add default scripts
            if (string.IsNullOrEmpty(xml))
            {
                Scripts = new BindingList<ScriptInfo>();
                AddDefaultScripts();
                return;
            }

            try
            {
                var serializer = new XmlSerializer(typeof(BindingList<ScriptInfo>));
                using (var stringReader = new StringReader(xml))
                using (var xmlReader = new XmlTextReader(stringReader))
                {
                    Scripts = serializer.Deserialize(xmlReader) as BindingList<ScriptInfo>;
                }
            }
            catch (Exception ex)
            {
                Scripts = new BindingList<ScriptInfo>();
                DeserializeFromOldFormat(xml);

                Trace.WriteLine(ex.Message);
            }
        }
开发者ID:semi836,项目名称:gitextensions,代码行数:27,代码来源:ScriptManager.cs


示例10: BaseJointShow

        public BaseJointShow(string name)
        {
            _name = name;

            _importedShows = new BindingList<IShow>();
            _showOrderList = new BindingList<IShow>();
        }
开发者ID:zh3,项目名称:BridgePresenter,代码行数:7,代码来源:BaseJointShow.cs


示例11: Convert

        /// <summary>
        /// Converts a value. 
        /// </summary>
        /// <returns>
        /// A converted value. If the method returns null, the valid null value is used.
        /// </returns>
        /// <param name="value">The value produced by the binding source.</param><param name="targetType">The type of the binding target property.</param><param name="parameter">The converter parameter to use.</param><param name="culture">The culture to use in the converter.</param>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            AudioTrack track = value as AudioTrack;
            if (track != null && track.ScannedTrack != null)
            {
                HBAudioEncoder encoder =
                    HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(track.Encoder));

                BindingList<HBMixdown> mixdowns = new BindingList<HBMixdown>();
                foreach (HBMixdown mixdown in HandBrakeEncoderHelpers.Mixdowns)
                {
                    if (HandBrakeEncoderHelpers.MixdownIsSupported(
                        mixdown,
                        encoder,
                        track.ScannedTrack.ChannelLayout))
                    {
                        mixdowns.Add(mixdown);
                    }
                }

                return mixdowns;
            }

            return value;
        }
开发者ID:galad87,项目名称:HandBrake-VideoToolbox,代码行数:32,代码来源:AudioMixdownListConverter.cs


示例12: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            TextItems = new BindingList<string>();

            TheItems.ItemsSource = TextItems;
        }
开发者ID:torkelo,项目名称:FuAsync,代码行数:7,代码来源:MainWindow.xaml.cs


示例13: KeyboardConsumer

        public KeyboardConsumer()
            : base()
        {
            singleStroke = false;

            keymappings = new BindingList<Keymapping>();
            InitKeys();
            _converter = new MovCodeToStringConverter();

            _movsToKeyCodes = new Dictionary<int, VirtualKeyCode>();

            _keyboardControl = new KeyboardControl();
            _keyboardControl.viewModel.keyboardConsumer = this;

            consumerControl = new BaseControl();

            ((BaseControl)consumerControl).viewModel.realtimeConsumer = this;
            ((BaseControl)consumerControl).itemsGrid.Children.Clear();
            ((BaseControl)consumerControl).itemsGrid.Children.Add(_keyboardControl);

            _simulator = new InputSimulator();

            //UpdateKeymappings();

            keymappings.ListChanged += keymappings_ListChanged;

            //Configuring a timer that will call the Keystroke method each 100 milliseconds.
            _timer = new FastTimer(3, 100, Keystroke);
        }
开发者ID:mgcarmueja,项目名称:MPTCE,代码行数:29,代码来源:KeyboardConsumer.cs


示例14: FormIgnores

        public FormIgnores()
        {
            InitializeComponent();

            Opcodes = new BindingList<ushort>(Ignores.I.Values);
            listOpcodes.DataSource = Opcodes;
        }
开发者ID:Epidal,项目名称:Ostara,代码行数:7,代码来源:FormIgnores.cs


示例15: ReadData

        public BindingList<RowModel> ReadData()
        {
            var list = new BindingList<RowModel>();

            string text = File.ReadAllText(FileName);

            string[] lines = text.Split('\n');

            foreach (var line in lines)
            {
                if (string.IsNullOrEmpty(line.Trim()))
                {
                    continue;
                }

                var values = line.Split(',');

                var id = int.Parse(values[0].Trim().Trim('\r'));
                var description = values[1].Trim().Trim('\r');
                var state = (State)Enum.Parse(typeof(State), values[2].Trim().Trim('\r'));
                var isCompleted = bool.Parse(values[3].Trim().Trim('\r'));

                var model = new RowModel
                {
                    Id = id,
                    Description = description,
                    State = state,
                    IsCompleted = isCompleted,
                };

                list.Add(model);
            }

            return list;
        }
开发者ID:IvanYurchenko,项目名称:WpfTestTask,代码行数:35,代码来源:FileService.cs


示例16: afiseazaStudentiCazati

 private void afiseazaStudentiCazati(object sender, EventArgs e)
 {
     int nr = Convert.ToInt32(textBox3.Text);
     double min = Convert.ToDouble(textBox4.Text);
     double max = Convert.ToDouble(textBox5.Text);
     List<FisaCazare> fise = new List<FisaCazare>();
     foreach (DataRowView drv in studentiBindingSource.List)
     {
         int suma = 0;
         int n = 0;
         foreach (DataRow dr in databaseDataSet.Tables[1].Rows)
             if (drv["Nr_matricol"].ToString().Equals(dr["Nr_matricol"].ToString()))
             {
                 suma += Convert.ToInt32(dr["Nota"].ToString());
                 n++;
             }
         FisaCazare fisa = new FisaCazare(drv["Nume"].ToString(), drv["Prenume"].ToString(), drv["Facultate"].ToString(), Convert.ToInt32(drv["An"].ToString()), Math.Round((double)suma / n,2));
         fise.Add(fisa);
     }
     List<FisaCazare> SortedList = fise.OrderByDescending(o => o.Medie).ToList().FindAll(c => (c.Medie<=max) && (c.Medie>=min));
     while (SortedList.Count > nr)
         SortedList.RemoveAt(SortedList.Count - 1);
     var bindingList = new BindingList<FisaCazare>(SortedList);
     var source = new BindingSource(bindingList, null);
     dataGridView1.DataSource = source;
 }
开发者ID:am1guma,项目名称:PSSC,代码行数:26,代码来源:UPT.cs


示例17: GetMarkedBatchIntervals

        public BindingList<BatchIntervalMarked> GetMarkedBatchIntervals(int captureBatchId)
        {
            BindingList<BatchIntervalMarked> intervals = new BindingList<BatchIntervalMarked>();

            using (var context = new PacketAnalysisEntity())
            {
                var batchIntervals = from b in context.BatchIntervals
                                     where b.CaptureBatchId == captureBatchId
                                     select new
                                     {
                                         b.BatchIntervalId,
                                         b.CaptureBatchId,
                                         b.IntervalNumber,
                                         b.PacketCount,
                                         b.CaptureBatch.Marked
                                     };

                foreach (var bi in batchIntervals)
                {
                    BatchIntervalMarked bim = new BatchIntervalMarked();
                    bim.BatchIntervalId = bi.BatchIntervalId;
                    bim.CaptureBatchId = bi.CaptureBatchId;
                    bim.IntervalNumber = bi.IntervalNumber;
                    bim.PacketCount = bi.PacketCount;
                    bim.Marked = bi.Marked == true ? CaptureState.Marked : CaptureState.Unmarked;
                    intervals.Add(bim);
                }
            }
            return intervals;
        }
开发者ID:sedev7,项目名称:cowe-project,代码行数:30,代码来源:BatchIntervalData.cs


示例18: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            MyApp = new Excel.Application();
            MyApp.Visible = false;
            MyBook = MyApp.Workbooks.Open(path);
            MySheet = (Excel.Worksheet)MyBook.Sheets[1];
            lastrow = MySheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row;

            BindingList<Dompet> DompetList = new BindingList<Dompet>();

            for (int index = 2; index <= lastrow; index++)
            {
                System.Array MyValues = 
                    (System.Array)MySheet.get_Range
                    ("A" + index.ToString(),"F" + index.ToString()).Cells.Value;
                DompetList.Add(new Dompet {
                    JmlPemesanan = MyValues.GetValue(1,1).ToString(),
                    JmlPekerja = MyValues.GetValue(1,2).ToString(),
                    Peralatan = MyValues.GetValue(1,3).ToString(),
                    JenisKulit = MyValues.GetValue(1,4).ToString(),
                    ModelDompet = MyValues.GetValue(1,5).ToString(),
                    Prediksi = MyValues.GetValue(1,6).ToString()
                });
            }
            dataGridView1.DataSource = (BindingList<Dompet>)DompetList;
            dataGridView1.AutoResizeColumns();
        }
开发者ID:renandatta,项目名称:NaiveBayes,代码行数:27,代码来源:FrmMain.cs


示例19: loadSomeData

 private void loadSomeData()
 {
     ProductAttributeService productAttrService = new ProductAttributeService();
     products = new BindingList<ProductAttributeModel>(productAttrService.GetProductAndAttribute());
     units = new BindingList<MeasurementUnit>(unitService.GetMeasurementUnits());
     if (entranceStock != null)
     {
         txtCode.Text = entranceStock.EntranceCode;
         txtNote.Text = entranceStock.Note;
         txtDate.Text = entranceStock.CreatedDate.ToString(BHConstant.DATE_FORMAT);
         txtUser.Text = entranceStock.SystemUser.FullName;
     }
     else
     {
         if (Global.CurrentUser != null)
         {
             txtUser.Text = Global.CurrentUser.FullName;
         }                
         txtUser.Enabled = false;
         txtDate.Text = BaoHienRepository.GetBaoHienDBDataContext().GetSystemDate().ToString(BHConstant.DATE_FORMAT);
         txtCode.Text = Global.GetTempSeedID(BHConstant.PREFIX_FOR_ENTRANCE);
     }
     txtDate.Enabled = false;
     txtUser.Enabled = false;
 }
开发者ID:psautomationteam,项目名称:manufacturingmanager,代码行数:25,代码来源:AddEntranceStock.cs


示例20: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsCallback)
        {
            //http://www.codeproject.com/articles/432860/asp-net-plotter-toolkit-html5-charting-for-all
            AlsiDBDataContext dc = new AlsiDBDataContext();
            var data = dc.OHLC_5_Minutes.Take(25000).ToList();
            Label1.Text = data.Count.ToString();
            Curve curve = new Curve();
            var points = new Point[data.Count];

            for (int x = 0; x < data.Count; x++)
            {
                var p = new Point(data[x].Stamp, data[x].C);
                points[x] = p;
            }


            BindingList<Curve> Curves = new BindingList<Curve> { curve };

            curve.Points = points;
            curve.Label = "Dfdfdfdff";

            Dygraph1.Curves = Curves;
         
            Dygraph1.YLowRange = data.Min(z => z.C);//if error check db
            Dygraph1.YHighRange = data.Max(z => z.C);
        }
        
    }
开发者ID:sanyaade-fintechnology,项目名称:NinjaTrader,代码行数:30,代码来源:ChartForm.aspx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BindingMemberDescriptor类代码示例发布时间:2022-05-24
下一篇:
C# BindingFlags类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap