Esempio n. 1
0
        public override void LoadMockData()
        {
            string        text          = string.IsNullOrEmpty(this.relativePath) ? this.listTitle : this.relativePath;
            string        path          = Path.Combine(MockClientContext.MockAttachmentDataProviderFilePath, text);
            DirectoryInfo directoryInfo = new DirectoryInfo(path);
            List <string> list          = new List <string>(this.viewFields);

            foreach (KeyValuePair <string, bool> keyValuePair in this.orderBy)
            {
                list.Add(keyValuePair.Key);
            }
            List <MockListItem> list2 = new List <MockListItem>();

            foreach (DirectoryInfo dirInfo in directoryInfo.GetDirectories())
            {
                list2.Add(new MockListItem(dirInfo, text, this.context));
            }
            foreach (FileInfo fileInfo in directoryInfo.GetFiles())
            {
                list2.Add(new MockListItem(fileInfo, text, this.context));
            }
            if (this.orderBy != null && this.orderBy.Count > 0)
            {
                list2.Sort((MockListItem item1, MockListItem item2) => this.Compare(item1, item2, 0));
            }
            ListItemCollectionPosition listItemCollectionPosition = this.listItemCollectionPosition;

            if (this.rowLimit > 0 && this.rowLimit < list2.Count)
            {
                MockListItem[] array = new MockListItem[this.rowLimit];
                list2.CopyTo(0, array, 0, this.rowLimit);
                list2 = new List <MockListItem>(array);
            }
            this.interalList = list2;
        }
Esempio n. 2
0
        private int Compare(MockListItem item1, MockListItem item2, int level)
        {
            if (level == this.orderBy.Count)
            {
                return(0);
            }
            string key   = this.orderBy[level].Key;
            bool   value = this.orderBy[level].Value;
            int    num   = item1[key].ToString().CompareTo(item2[key].ToString()) * (value ? 1 : -1);

            if (num != 0)
            {
                return(num);
            }
            return(this.Compare(item1, item2, level + 1));
        }
Esempio n. 3
0
 // Token: 0x06000062 RID: 98 RVA: 0x00002779 File Offset: 0x00000979
 public MockFile(MockListItem mockListItem, MockClientContext context)
 {
     this.ListItemAllFields = mockListItem;
     this.context           = context;
 }
 // Token: 0x06000083 RID: 131 RVA: 0x00002C39 File Offset: 0x00000E39
 public MockFolder(MockListItem mockListItem, MockClientContext context)
 {
     this.ListItemAllFields = mockListItem;
     this.ServerRelativeUrl = (string)mockListItem["FileRef"];
     this.context           = context;
 }