AddInclude() public method

public AddInclude ( String key, String service, String className ) : void
key String
service String
className String
return void
示例#1
0
        private void ConfigureScanner(IConfiguration config, ComponentScanner scanner)
        {
            if (config.Attributes["useAttributes"] != null)
            {
                scanner.UseAttributes = config.Attributes["useAttributes"].Equals("true");
            }

            foreach (IConfiguration innerConfig in config.Children)
            {
                if ("include".Equals(innerConfig.Name))
                {
                    String key       = innerConfig.Attributes["key"];
                    String service   = innerConfig.Attributes["service"];
                    String component = innerConfig.Attributes["component"];

                    scanner.AddInclude(key, service, component);
                }
                else if ("exclude".Equals(innerConfig.Name))
                {
                    String type = innerConfig.Attributes["type"];

                    scanner.AddExclude(type);
                }
                else
                {
                    throw new ConfigurationException("Invalid node inside assemblyBatch " +
                                                     "configuration. Expected 'include' or 'exclude'");
                }
            }
        }
		private void ConfigureScanner(IConfiguration config, ComponentScanner scanner)
		{
			if (config.Attributes["useAttributes"] != null)
			{
				scanner.UseAttributes = config.Attributes["useAttributes"].Equals("true");
			}
	
			foreach(IConfiguration innerConfig in config.Children)
			{
				if ("include".Equals(innerConfig.Name) )
				{
					String key = innerConfig.Attributes["key"];
					String service = innerConfig.Attributes["service"];
					String component = innerConfig.Attributes["component"];

					scanner.AddInclude( key, service, component );
				}
				else if ("exclude".Equals(innerConfig.Name) )
				{
					String type = innerConfig.Attributes["type"];

					scanner.AddExclude( type );
				}
				else
				{
					String message = "Invalid node inside assemblyBatch configuration. Expected 'include' or 'exclude'";

					throw new ConfigurationErrorsException(message);
				}
			}
		}