WikiCrawler/Utility/CreatorUtility.cs
/// <summary>
/// Saves cached creator data out to files.
/// </summary>
Saves cached creator data out to files.
Saves cached creator data out to files .
public static void SaveOut()
		{
			string creatorTemplatesFile = CacheFile;
			using (StreamWriter writer = new StreamWriter(new FileStream(creatorTemplatesFile, FileMode.Create, FileAccess.Write), Encoding.UTF8))
			{
				writer.WriteLine("{");
				List<KeyValuePair<string, Creator>> creatorsFlat = new List<KeyValuePair<string, Creator>>(s_creatorData);
				bool first = true;
				foreach (KeyValuePair<string, Creator> kv in creatorsFlat
					.OrderByDescending(kv => kv.Value.Usage)
					.OrderByDescending(kv => kv.Value.UploadableUsage))
				{
					if (!first)
					{
						writer.WriteLine(',');
					}
					else
					{
						first = false;
					}
					writer.Write(Newtonsoft.Json.JsonConvert.SerializeObject(kv.Key) + ":");
					writer.Write(Newtonsoft.Json.JsonConvert.SerializeObject(kv.Value, Newtonsoft.Json.Formatting.Indented));
				}
				writer.WriteLine("}");
			}
		}
public static void SaveOut ( ) { string creatorTemplatesFile = CacheFile ; using ( StreamWriter writer = new StreamWriter ( new FileStream ( creatorTemplatesFile , FileMode . Create , FileAccess . Write ) , Encoding . UTF8 ) ) { writer . WriteLine ( " " ) ; List < KeyValuePair < string , Creator > > creatorsFlat = new List < KeyValuePair < string , Creator > > ( s_creatorData ) ; bool first = true ; foreach ( KeyValuePair < string , Creator > kv in creatorsFlat . OrderByDescending ( kv => kv . Value . Usage ) . OrderByDescending ( kv => kv . Value . UploadableUsage ) ) { if ( ! first ) { writer . WriteLine ( ' ' ) ; } else { first = false ; } writer . Write ( Newtonsoft . Json . JsonConvert . SerializeObject ( kv . Key ) + " " ) ; writer . Write ( Newtonsoft . Json . JsonConvert . SerializeObject ( kv . Value , Newtonsoft . Json . Formatting . Indented ) ) ; } writer . WriteLine ( " " ) ; } }
Saves cached creator data out to files.
Saves cached creator data out to files .
//write creators