本文整理汇总了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();
}
);
}
);
};
}
);
}
示例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;
}
示例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));
}
示例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>();
}