コード例 #1
0
		/// <summary>
		/// </summary>
		/// <param name="compiler"></param>
		/// <param name="context"></param>
		/// <returns></returns>
		public IEnumerable<XElement> GetSources(IBSharpCompiler compiler, IBSharpContext context){
			if (string.IsNullOrWhiteSpace(ResourceMarker)) throw new Exception("marker not set");
            foreach (string rname in GetType().Assembly.FindAllResourceNames(ResourceMarker)){
               string resource = GetType().Assembly.ReadManifestResource(rname);
				yield return Parser.Parse(resource, rname);
			}
		}
コード例 #2
0
 /// <summary>
 /// </summary>
 /// <param name="compiler"></param>
 /// <param name="context"></param>
 /// <returns></returns>
 public IEnumerable <XElement> GetSources(IBSharpCompiler compiler, IBSharpContext context)
 {
     if (string.IsNullOrWhiteSpace(ResourceMarker))
     {
         throw new Exception("marker not set");
     }
     foreach (string rname in GetType().Assembly.FindAllResourceNames(ResourceMarker))
     {
         string resource = GetType().Assembly.ReadManifestResource(rname);
         yield return(Parser.Parse(resource, rname));
     }
 }
コード例 #3
0
 private static void SetupGlobals(ConfigurationOptions options, IBSharpCompiler compiler)
 {
     compiler.InitGlobals();
     if (options.AddNameToGlobalConditions && !string.IsNullOrWhiteSpace(options.Name))
     {
         var cond = "APP_" + options.Name.ToUpperInvariant();
         if (!compiler.Global.ContainsKey(cond))
         {
             compiler.Global[cond] = true;
         }
         if (!compiler.Global.ContainsKey(options.ConfigNameBSharpPrefix))
         {
             compiler.Global[options.ConfigNameBSharpPrefix] = options.Name;
         }
     }
 }