當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。