Ejemplo n.º 1
0
		public static bool TryLoadPresets(DCompilerConfiguration compiler)
		{
			if(compiler!=null)
				foreach (var kv in presetFileContents)
				{
					if (kv.Key == compiler.Vendor)
					{
						var x = new XmlTextReader(new StringReader(kv.Value));
						x.Read();

						compiler.DefaultLibraries.Clear();
						compiler.IncludePaths.Clear();

						compiler.ReadFrom(x);

						x.Close();
						FitFileExtensions(compiler);
						return true;
					}
				}

			return false;
		}
Ejemplo n.º 2
0
        public static DCompilerConfiguration LoadFromString(string xmlCode)
        {
            var cmp = new DCompilerConfiguration();

            var x = new XmlTextReader(new StringReader(xmlCode));

            if (x.ReadToFollowing("Compiler"))
            {
                if (x.MoveToAttribute("Name"))
                {
                    cmp.Vendor = x.ReadContentAsString();
                    x.MoveToElement();
                }

                cmp.ReadFrom(x);
            }

            x.Close();

            FitFileExtensions(cmp);

            return cmp;
        }