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


C# BindingList类代码示例

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


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


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