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


C# BindingList.First方法代码示例

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


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

示例1: RateCalculatorForm

        public RateCalculatorForm()
        {
            InitializeComponent();
            closeButton.Click += OnCloseButtonClick;
            saveButton.Click += OnSaveButtonClick;
            testButton.Click += OnTestButtonClick;

            parameters = new Dictionary<int, string>();
            foreach (object[] d in DataHelper.GetParameters())
            {
                parameters.Add((int)d[0], (string)d[1]);
            }
            repositoryItemComboBox1.Items.Add(string.Empty);
            repositoryItemComboBox1.Items.AddRange(parameters.Values.OrderBy(v => v).ToArray());
            formulas = new BindingList<Formula>(DataHelper.GetFormulas());
            gridRateList.DataSource = formulas;
            modifiedObjects = new Dictionary<int, int>();
            modifiedParams = new Dictionary<int, int>();
            viewRateList.CustomDrawCell += (_,e) => OnCustomDrawCell(false, e);
            viewRateList.CellValueChanged += OnCellValueChanged;
            viewRateList.FocusedRowChanged += OnFocusedRowChanged;

            viewRateParams.CustomDrawCell += (_, e) => OnCustomDrawCell(true, e);
            viewRateParams.CellValueChanged += OnParamCellValueChanged;

            if (formulas.Count > 0)
            {
                viewRateList.SelectRow(0);
                formParameters = new BindingList<FormulaParameter>(formulas.First().Parameters);
                tbFormulaExp.Text = formulas.First().Expression;
            }
            else
            {
                formParameters = new BindingList<FormulaParameter>();
                tbFormulaExp.Text = string.Empty;
            }
            testCalcValue.Text = string.Empty;
            gridRateParams.DataSource = formParameters;
            validButton.Click += OnValidButtonClick;
            tbFormulaExp.TextChanged += OnTextChanged;
            testValues = new List<TestValue>();
        }
开发者ID:ryazantsevanton,项目名称:Rossapn_newdesign,代码行数:42,代码来源:RateCalculatorForm.cs

示例2: AssertMatchShows

        private void AssertMatchShows(BindingList<IJointShow> sourceShows, BindingList<IJointShow> loadedShows)
        {
            Assert.AreEqual(sourceShows.Count, loadedShows.Count);

            foreach (IJointShow jointShow in loadedShows)
            {
                IJointShow matchingSourceShow = sourceShows.First(sourceShow => sourceShow.Name == jointShow.Name);
                Assert.NotNull(matchingSourceShow);

                BindingList<IShow> importedShows = (BindingList<IShow>)matchingSourceShow.ImportedShowsDataSource;
                BindingList<IShow> showOrderShows = (BindingList<IShow>)matchingSourceShow.ShowOrderDataSource;
                foreach (IShow showOrderShow in jointShow.ShowOrderShows)
                    Assert.IsTrue(importedShows.Any(show => show.Path == showOrderShow.Path));

                foreach (IShow importedShow in showOrderShows)
                    Assert.IsTrue(importedShows.Any(show => show.Path == importedShow.Path));
            }
        }
开发者ID:zh3,项目名称:BridgePresenter,代码行数:18,代码来源:JointShowPersistentLoaderTest.cs

示例3: MainViewModel

        private MainViewModel()
        {
            NewCommand = new RelayCommand(CreateNew);
            OpenCommand = new RelayCommand(Open);
            SaveCommand = new RelayCommand(Save, CanSave);
            SaveAsCommand = new RelayCommand(SaveAs, CanSave);
            ExportCommand = new RelayCommand(Export, CanSave);
            UndoCommand = new RelayCommand(Undo, CanUndo);
            RedoCommand = new RelayCommand(Redo, CanRedo);

            OpenProjects = new BindingList<Project>();
            EditorModes = new BindingList<EditorMode>
            {
                EditorMode.Cursor,
                EditorMode.Line,
                EditorMode.Arc,
                EditorMode.Bezier,
                EditorMode.Spline,
            };
            currentEditorMode = EditorModes.First();
        }
开发者ID:Artentus,项目名称:GameUtils,代码行数:21,代码来源:MainViewModel.cs

示例4: AnimatedToolbarCanvas

        public AnimatedToolbarCanvas()
        {
            var ButtonOuterWidth = 16 + 4;

            Items = new BindingList<AnimatedToolbarItem>();
            Items.WithEvents(
                (AddedSource, AddedIndex) =>
                {
                    AddedSource.x = AddedIndex * ButtonOuterWidth;
                    AddedSource.cx = 8;

                    AddedSource.Button = new Canvas
                    {
                        Cursor = Cursors.Hand
                    }.AttachTo(this);

                    AddedSource.MoveTo =
                        delegate
                        {
                            AddedSource.Button.MoveTo(AddedSource.x + AddedSource.cx, 0);
                        };

                    #region ItemClicked
                    AddedSource.Button.MouseLeftButtonUp +=
                        delegate
                        {
                            if (ItemClicked != null)
                                ItemClicked(AddedSource);
                        };
                    #endregion

                    #region ItemMouseEnter
                    AddedSource.Button.MouseEnter +=
                        (e, s) =>
                        {

                            if (ItemMouseEnter != null)
                                ItemMouseEnter(AddedSource, s);
                        };
                    #endregion

                    #region ItemMouseLeave
                    AddedSource.Button.MouseLeave +=
                      (e, s) =>
                      {


                          if (ItemMouseLeave != null)
                              ItemMouseLeave(AddedSource, s);
                      };
                    #endregion

                    AddedSource.Button.MouseEnter +=
                        delegate
                        {
                            SelectedItem = AddedSource;
                        };

                    AddedSource.a = AddedSource.Button.ToAnimatedOpacity();
                    AddedSource.a.Opacity = 0;

                    #region fade in and slide left
                    AddedSource.Image.AttachTo(AddedSource.Button);

                    AddedSource.a.Opacity = 1;

                    if (AddedSource.cx > 0)
                        (1000 / 60).AtIntervalWithTimerAndCounter(
                            (t, c) =>
                            {
                                AddedSource.cx--;

                                AddedSource.MoveTo();

                                if (AddedSource.cx > 0)
                                    return;

                                t.Stop();
                            }
                        );
                    #endregion

                    #region StartAnimatingRemove
                    Action StartAnimatingRemove =
                        delegate
                        {
                            if (Items.Count > MaxItems)
                            {
                                Items.First().With(
                                    RemovedSource =>
                                    {
                                        RemovedSource.a.SetOpacity(0,
                                            delegate
                                            {
                                                RemovedSource.Button.Orphanize();
                                                RemovedSource.Button = null;
                                            }
                                        );

                                        Items.Remove(RemovedSource);
//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:AnimatedToolbarCanvas.cs

示例5: DoProcesses

        private void DoProcesses(BindingList<Process> _processes)
        {
            while (programIsRunning || _processes.Count > 0)
            {
                if (_processes.Count > 0)
                {
                    mut.WaitOne();
                    List<Process> sortedProcesses = _processes.OrderBy(x => x.Priority).ToList();
                    mut.ReleaseMutex();
                    sortedProcesses[0].Execute();
                    this.Invoke((Action) (() =>
                    {
                        results.First(x => x.ProcessId == sortedProcesses[0].Id).PauseTime =
                            sortedProcesses[0].GetPauseTime();
                        results.First(x => x.ProcessId == sortedProcesses[0].Id).EndTime = watch.ElapsedMilliseconds;
                        _processes.Remove(_processes.First(x => x.Id == sortedProcesses[0].Id));
                        dataGridViewResults.Refresh();
                    }));
                }
                else
                {
                    Thread.Sleep(10);
                    processorFreeTime += 10;
                }

            }
            ActionsAfterProgramStops();
        }
开发者ID:TkachenkoRoman,项目名称:SPO_lab3_processor_planning,代码行数:28,代码来源:Form1.cs

示例6: init

 public void init()
 {
     smartphones = DataManager.getSmartphones();
     phonesListBox.DataSource = smartphones;
     phonePictureBox.Image = smartphones.First().image;
 }
开发者ID:VladasZ,项目名称:Homework,代码行数:6,代码来源:Form1.cs


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