Exemplo n.º 1
0
		/// <summary>
		/// Loads the configuration file.
		/// </summary>
		private static void Load()
		{
						
			XmlSerializer serializer = new XmlSerializer(typeof(LibraryConfig),
			                                              GetSerializationOverrides());	
			
			string path = PathUtils.GetConfigFilePath("MathTextLibrary");
			
			Stream configStream;
			
			if(File.Exists(path))
			{			                                           
				configStream = new FileStream(path,FileMode.Open);
				
				// Deserializamos
				config = (LibraryConfig)serializer.Deserialize(configStream);					
				configStream.Close();
				
				return;
			}
			else
			{
				config = new LibraryConfig();
				
				
				config.Symbols.Add(new SymbolLabelInfo("√", @"\surd"));
				config.Symbols.Add(new SymbolLabelInfo("∑", @"\sum"));
				config.Symbols.Add(new SymbolLabelInfo("∏", @"\prod"));
				config.Symbols.Add(new SymbolLabelInfo("∫", @"\int"));
				config.Symbols.Add(new SymbolLabelInfo("∲", @"\oint"));
				config.Symbols.Add(new SymbolLabelInfo("⋂", @"\bigcap"));
				config.Symbols.Add(new SymbolLabelInfo("∩", @"\cap"));
				config.Symbols.Add(new SymbolLabelInfo("⋃", @"\bigcup"));
				config.Symbols.Add(new SymbolLabelInfo("∪", @"\cup"));			
				config.Symbols.Add(new SymbolLabelInfo("⋀", @"\bigwedge"));
				config.Symbols.Add(new SymbolLabelInfo("∧", @"\wedge"));
				config.Symbols.Add(new SymbolLabelInfo("⋁", @"\bigvee"));
				config.Symbols.Add(new SymbolLabelInfo("∨", @"\vee"));
				config.Symbols.Add(new SymbolLabelInfo("∊", @"\in"));
				config.Symbols.Add(new SymbolLabelInfo("∀", @"\forall"));
				config.Symbols.Add(new SymbolLabelInfo("∃", @"\exists"));
				config.Symbols.Add(new SymbolLabelInfo("∄", @"\nexists"));
				config.Symbols.Add(new SymbolLabelInfo("∞", @"\infty"));
				config.Symbols.Add(new SymbolLabelInfo("→", @"\rightarrow"));
				config.Symbols.Add(new SymbolLabelInfo("≈", @"\simeq"));
					
			
			}
			
			
			
		}