public static List <ReportPackage> ToReportPackages( this List <SessionModel> sessions) { Dictionary <SessionModel, string> dictionary1 = sessions.ToDictionary <SessionModel, SessionModel, string>((Func <SessionModel, SessionModel>)(s => s), (Func <SessionModel, string>)(s => s.ReportParameters)); Dictionary <string, List <ReportMessage.Session> > dictionary2 = dictionary1.Values.Distinct <string>().ToDictionary <string, string, List <ReportMessage.Session> >((Func <string, string>)(p => p), (Func <string, List <ReportMessage.Session> >)(p => new List <ReportMessage.Session>())); foreach (KeyValuePair <SessionModel, string> keyValuePair in dictionary1) { dictionary2[keyValuePair.Value].Add((ReportMessage.Session)keyValuePair.Key); } List <ReportPackage> list1 = dictionary2.Select <KeyValuePair <string, List <ReportMessage.Session> >, ReportPackage>((Func <KeyValuePair <string, List <ReportMessage.Session> >, ReportPackage>)(i => new ReportPackage(i.Key, (IEnumerable <ReportMessage.Session>)i.Value))).ToList <ReportPackage>(); label_6: List <ReportPackage> list2 = list1.Where <ReportPackage>((Func <ReportPackage, bool>)(p => p.IsLarge)).ToList <ReportPackage>(); if (list2.Count == 0) { return(list1); } using (List <ReportPackage> .Enumerator enumerator = list2.GetEnumerator()) { while (enumerator.MoveNext()) { ReportPackage current = enumerator.Current; list1.Remove(current); list1.AddRange((IEnumerable <ReportPackage>)current.Split()); } goto label_6; } }
public ReportPackage(string urlParameters, IEnumerable <ReportMessage.Session> sessions) { this.Key = string.Format(Memory.ActiveBox.KeyFormat, (object)Guid.NewGuid()); this.UrlParameters = urlParameters; this._reportMessage = ReportPackage.ToReportMessage(sessions); this._rawStream = this.GetRawStream(); }