コード例 #1
0
		public static void GetAllCategoriesFeatures(ApiContext context)
		{
			FeaturesDownloader downloader = new FeaturesDownloader(context);
			GetCategoryFeaturesResponseType resp = downloader.GetCategoryFeatures();
			CategoryFeatureTypeCollection cfCol = resp.Category;
				
			//cache the features in hashtable	
			foreach(CategoryFeatureType cf in cfCol)
			{
				cfsTable.Add(cf.CategoryID, cf);
			}
			
			//cache site defaults
			siteDefaults = resp.SiteDefaults;
			//cahce feature definitions
			featureDefinition = resp.FeatureDefinitions;
		}
コード例 #2
0
 private void SyncAllCategoriesFeatures()
 {
     if (!siteCategoriesFeaturesTable.ContainsKey(apiContext.Site))
     {
         FeaturesDownloader downloader = new FeaturesDownloader(apiContext);
         GetCategoryFeaturesResponseType resp = downloader.GetCategoryFeatures();
         CategoryFeatureTypeCollection cfCol = resp.Category;
         Hashtable cfsTable = new Hashtable(TABLE_SIZE);
         foreach (CategoryFeatureType cf in cfCol)
         {
             cfsTable.Add(cf.CategoryID, cf);
         }
         siteCategoriesFeaturesTable.Add(apiContext.Site, cfsTable);
         siteFeatureDefaultTable.Add(apiContext.Site, resp.SiteDefaults);
         siteFeatureDefinitionsTable.Add(apiContext.Site, resp.FeatureDefinitions);
     }
 }