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


C# BindingList.ToArray方法代码示例

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


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

示例1: AnimatedToolbarCanvas


//.........这里部分代码省略.........
                      };
                    #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);

                                    }
                                );
                            }
                        };

                    StartAnimatingRemove();
                    #endregion


                    return (RemovedSource, RemovedIndex) =>
                    {
                        //RemovedSource.Button.Orphanize();
                        //RemovedSource.Button = null;

                        if (SelectedItem == RemovedSource)
                            SelectedItem = null;

                        var u = Items.ToArray();
                        200.AtDelay(
                            delegate
                            {
                                (1000 / 20).AtIntervalWithTimerAndCounter(
                                    (t, c) =>
                                    {
                                        u.WithEach(
                                            k =>
                                            {
                                                k.x -= 4;
                                                k.MoveTo();


                                            }
                                        );

                                        if (c < 4)
                                            return;

                                        t.Stop();

                                    }
                                );
                            }
                        );
                    };
                }
            );

        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:AnimatedToolbarCanvas.cs

示例2: initRules

            static BindingList<string> initRules() {
                List<string> list;
                if (settings.CustomRules != "")
                    list = new List<string>(settings.CustomRules.Split('\n'));
                else
                    list = new List<string>();

                var bingdingList = new BindingList<string>(list);
                bingdingList.ListChanged += (sender, e) => {
                    settings.CustomRules = String.Join("\n", bingdingList.ToArray());
                };
                return bingdingList;
            }
开发者ID:kevenme,项目名称:x-wall,代码行数:13,代码来源:Rules.cs

示例3: OnClick

      protected override void OnClick(EventArgs e)
      {
        BindingList<WtsSeriesAnalyzer.WtRestriction> list = new BindingList<WtsSeriesAnalyzer.WtRestriction>();
        Array.ForEach(m_analyzer.SourceWts.ColumnHeadings, delegate(string name_) { list.Add(new WtsSeriesAnalyzer.WtRestriction(name_)); });

        ShowForm sf = new ShowForm();
        ApplyWeightRestrictionsControl con = new ApplyWeightRestrictionsControl(list);
        sf.Create(con);

        DialogResult result = DialogResult.Cancel;
        try
        {
          result = sf.ShowDialog();
        }
        catch
        {
          result = DialogResult.Cancel;
        }

        if (result == DialogResult.Cancel)
          return;

        ConstructGen<double> processWeights = m_analyzer.WhatIfTradingRestrictions(list.ToArray());

        var res = SI.Data.ReturnsFromFXWeights.DoIt_DailyWeights(processWeights);

        GetCov covDel = date_ => Singleton<CovarianceSource>.Instance.GetCovarianceForDateElesePrevious(date_);

        WtsSeriesAnalyzer w = new WtsSeriesAnalyzer(
          name_: string.Format("{0}_restricted",m_analyzer.Name),
          wts_: processWeights,
          dailyReturns_: res.CombinedPnl,
          covDelegate_: covDel
        );

        WtsSeriesAnalyzer original = new WtsSeriesAnalyzer(
          m_analyzer.Name,
          m_analyzer.SourceWts,
          m_analyzer.Performance,
          covDel);

        List<WtsSeriesAnalyzer> ll = new List<WtsSeriesAnalyzer>();
        ll.Add(original);
        ll.Add(w);



        WtsAnalysisCompareControl comparer = new WtsAnalysisCompareControl();
        comparer.Create(ll);
        comparer.DisplayInShowForm(string.Format("{0} before and after restricted weights", m_analyzer.Name));

      }
开发者ID:heimanhon,项目名称:researchwork,代码行数:52,代码来源:WtsAnalysisCompareControl.cs

示例4: GetTestsByVisit

 public DtoTest[] GetTestsByVisit(string billingNumber)
 {
     string sexCode = VisitMethods.Instance.GetVisitByBillingNumber(billingNumber).Patient.Sex.Code;
     TestSexAllowed[] testSexAlloweds = TestSexAllowedMethods.Instance.GetTestSexAllowedBySex(sexCode);
     var testInstance = new Test()
     {
         Code = string.Empty,
         Name = string.Empty
     };
     Test[] tests = TestMethods.Instance.GetTests(testInstance.Code, testInstance.Name);
     var query = from testSexAllowed in testSexAlloweds
                 join test in tests
                 on testSexAllowed.Test.Id equals test.Id
                 select new DtoTest()
                 {
                     Id = test.Id,
                     Code = test.Code,
                     Name = test.Name,
                     Cost = test.Cost,
                     DefaultSpecimen = new DtoSpecimen()
                     {
                         Id= test.DefaultSpecimen.Id,
                         Code = test.DefaultSpecimen.Code
                     }
                 };
     var testsBySex = new BindingList<DtoTest>();
     foreach (var testBySex in query)
     {
         testsBySex.Add(testBySex);
     }
     return testsBySex.ToArray<DtoTest>();
 }
开发者ID:abonSerg,项目名称:Clinic,代码行数:32,代码来源:TestService.svc.cs


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