本文整理汇总了C#中ObservableCollection.Reverse方法的典型用法代码示例。如果您正苦于以下问题:C# ObservableCollection.Reverse方法的具体用法?C# ObservableCollection.Reverse怎么用?C# ObservableCollection.Reverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObservableCollection
的用法示例。
在下文中一共展示了ObservableCollection.Reverse方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached.
/// This parameter is typically used to configure the page.</param>
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
Note = await App.DataModel.get_Notes();
// sort the ObservableCollection by date (the default property)
noteSort = new ObservableCollection<Notes>(Note.OrderBy(note => note));
noteSort = new ObservableCollection<Notes>(noteSort.Reverse());
noteFilter = noteSort;
this.DataContext = noteFilter;
}
示例2: AddNewTweets
public void AddNewTweets(ObservableCollection<NGTweeterStatus> tweeterStatuses)
{
tweeterStatuses.Reverse();
DispatcherHelper.CheckBeginInvokeOnUI(
() => tweeterStatuses.OrderBy(ts => ts.CreatedDate).ToList().ForEach(
t =>
{
if (t.RetweetedStatus == null)
_tweeterStatusViewModels.Insert(0, new TweetViewModel(t));
else
{
_tweeterStatusViewModels.Insert(0, new RetweetViewModel(t));
}
}));
}
示例3: GetNewMentionsAsync
/// <summary>
/// 新着Mensionsを取得します。
/// Newtonsoft-Jsonを利用しています。
/// </summary>
public async Task GetNewMentionsAsync()
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
ObservableCollection<Status> tempStatusList = new ObservableCollection<Status>();
tempStatusList.Clear();
string latestId = mentionsStatusList.First().id_str;
parameters.Clear();
parameters.Add("since_id", latestId);
string Json = await Get(MENTIONS_URL, parameters);
tempStatusList = (ObservableCollection<Status>)JsonConvert.DeserializeObject(Json, typeof(ObservableCollection<Status>));
var reversedTempStatusList = tempStatusList.Reverse();
foreach (var item in reversedTempStatusList)
{
mentionsStatusList.Insert(0, item);
}
}
示例4: AnalysisUnitFunction
//.........这里部分代码省略.........
string a = Home.AnalysisTempMember[BaseBound].Num;
//temp = InnerCacu(a, Home.TempMember[i].elea);
char b = Convert.ToChar(tmp1 + 48);
int index = a.IndexOf(b);
int basebound = 0;
basebound = BaseBound + 9;
if (BaseBound > Home.AnalysisTempMember.Count - 1 - 9)
basebound = Home.AnalysisTempMember.Count - 1;
if (index == 3)
{
coldTime++;
switch (Analysisflag)
{
case 'A':
tmp = tmp1 + Home.AnalysisTempMember[basebound].elea;
AlgorithmFormula = AlgorithmFormula0 + "+A";
break;
case 'B':
tmp = tmp1 + Home.AnalysisTempMember[basebound].eleb;
AlgorithmFormula = AlgorithmFormula0 + "+B";
break;
case 'C':
tmp = tmp1 + Home.AnalysisTempMember[basebound].elec;
AlgorithmFormula = AlgorithmFormula0 + "+C";
break;
case 'D':
tmp = tmp1 + Home.AnalysisTempMember[basebound].eled;
AlgorithmFormula = AlgorithmFormula0 + "+D";
break;
default:
break;
}
if (tmp >= 10)
{
tmp = tmp % 10;
}
for (int j = 0; j < rowElementNum; j++)
{
string a0 = CommonAnalsisAnrry[(tmp1 - 1) * rowElementNum + j, 0];
//temp = InnerCacu(a, Home.TempMember[i].elea);
char b0 = Convert.ToChar(tmp + 48);
int index0 = a0.IndexOf(b0);
if (index0 != -1)
{
int count = Convert.ToInt32(CommonAnalsisAnrry[(tmp1 - 1) * rowElementNum + j, 1]);
count = count + 1;
CommonAnalsisAnrry[(tmp1 - 1) * rowElementNum + j, 1] = Convert.ToString(count);
}
}
}
}
for (int tmpi = 0; tmpi < rowElementNum; tmpi++)
{
if (CommonAnalsisAnrry[(tmp1 - 1) * rowElementNum + tmpi, 1] == "0")
{
Result.Add(new tempResolveHelp(coldTime, AlgorithmFormula, CommonAnalsisAnrry[(tmp1 - 1) * rowElementNum + tmpi, 0], InnerCacu(CommonAnalsisAnrry[(tmp1 - 1) * rowElementNum + tmpi, 0], tmp1)));
}
}
break;
default:
break;
}
for (int tmpk = 0; tmpk < CommonAnalsisAnrry.GetLength(0); tmpk++)
{
CommonAnalsisAnrry[tmpk, 1] = "0";
}
}
}
//前端显示
for (int tmpi = coldBound; tmpi < Result.Count; tmpi++)
{
if (Result[tmpi].coldTime >= coldBound)
{
ResultHelper.Add(new ResolveHelper() { AlgorithmFormula = Result[tmpi].AlgorithmFormula, KuangNum = Result[tmpi].KuangNum, ResultNum = Result[tmpi].ResultNum, ColdTime = Result[tmpi].coldTime });
}
}
//按照ColdTime大小排序
var tempResultRanked = from resluthelp in ResultHelper
orderby resluthelp.ColdTime
select resluthelp;
ResultHelper = new ObservableCollection<ResolveHelper>(tempResultRanked);
List<ResolveHelper> tmpZeroList = ResultHelper.Reverse().ToList();//数据反转,连续次数多的在最上面
ResultHelper.Clear();
for (int i = 0; i < tmpZeroList.Count; i += 1)
{
ResultHelper.Add(tmpZeroList[i]);
}
ReslutTable.DataContext = ResultHelper;
}
}
catch (Exception ex)
{
mainDialog.ShowMessage(ex.Message, "温馨提示:", MessageBoxButton.OK, null);
}
}
示例5: getComments
private async Task getComments()
{
WebRequest wr = WebRequest.Create("https://public-api.wordpress.com/rest/v1/sites/bellyofauthority.wordpress.com/posts/" + postID + "/replies");
WebResponse response = await wr.GetResponseAsync();
Stream objResponse = response.GetResponseStream();
StreamReader reader = new StreamReader(objResponse);
string data = reader.ReadToEnd();
CommentWrapper comments = JsonConvert.DeserializeObject<CommentWrapper>(data);
ObservableCollection<Comment> processedComments = new ObservableCollection<Comment>();
foreach (Comment c in comments.comments)
{
processedComments.Add(processComment(c));
}
this.comments = new ObservableCollection<Comment>(processedComments.Reverse());
}
示例6: TestClass
public TestClass(StockParser parser)
{
testList = parser.Parse(new System.IO.StreamReader("Nordea.csv"));
testList = new ObservableCollection<DataClass>(testList.Reverse());
i = 0;
}