예제 #1
0
        private void UpdateBase(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl, GameFileGetOptions options, IEnumerable <GameFileSearchField> searchFields)
        {
            IEnumerable <IGameFileDataSource> first = new IGameFileDataSource[0];

            GameFileFieldType[] defaultGameFileSelectFields = this.DefaultGameFileSelectFields;
            if (options == null)
            {
                foreach (GameFileSearchField field in searchFields)
                {
                    first = first.Union <IGameFileDataSource>(adapter.GetGameFiles(new GameFileGetOptions(defaultGameFileSelectFields, field)));
                }
            }
            else
            {
                foreach (GameFileSearchField field2 in searchFields)
                {
                    options.SearchField = field2;
                    first = first.Union <IGameFileDataSource>(adapter.GetGameFiles(options));
                }
                if (options.SearchField != null)
                {
                    first = first.Union <IGameFileDataSource>(adapter.GetGameFiles(new GameFileGetOptions(defaultGameFileSelectFields, options.SearchField)));
                }
            }
            this.SetDataSource(ctrl, first.ToList <IGameFileDataSource>());
        }
예제 #2
0
 private void Update(IGameFileDataSourceAdapter adapter, GameFileViewControl ctrl, GameFileGetOptions options, IEnumerable <GameFileSearchField> searchFields)
 {
     if ((searchFields == null) || (searchFields.Count <GameFileSearchField>() == 0))
     {
         if (options == null)
         {
             this.SetDataSource(ctrl, adapter.GetGameFiles().ToList <IGameFileDataSource>());
         }
         else
         {
             this.SetDataSource(ctrl, adapter.GetGameFiles(options).ToList <IGameFileDataSource>());
         }
     }
     else
     {
         this.UpdateBase(adapter, ctrl, options, searchFields);
     }
 }