public static void Main(string[] args) { if (args.Length != 3) { Console.WriteLine("Usage: dns-server <config-file> <ip-address> <port>"); Environment.Exit(1); } var config = new XmlDocument(); config.Load(args[0]); var zone = DNSZone.Unserialize(config); var clock = new StopwatchClock(); var cache = new ResolverCache(clock, 2048); var resolver = new StubResolver(cache, ResolverUtils.SendQuery); var query_exec = new QueryExecutor(zone, resolver, cache); var bind_addr = new IPEndPoint(IPAddress.Parse(args[1]), int.Parse(args[2])); var server = new UDPServer(bind_addr, query_exec); server.Start(); }
/// <summary> /// Ctor /// </summary> /// <param name="resolverCache"></param> /// <param name="allowNullValueTypes"></param> public TypeCoercionUtility(ResolverCache resolverCache, bool allowNullValueTypes) { if (resolverCache == null) { throw new ArgumentNullException("resolverCache"); } this.ResolverCache = resolverCache; this.AllowNullValueTypes = allowNullValueTypes; }
static FilesController() { ResolverCache.Add( nameof(DXFBoundariesRequest), new JsonSerializerSettings() { ContractResolver = new IgnorePropertiesResolver( new[] { nameof(DXFBoundariesRequest.CSIBFileData), nameof(DXFBoundariesRequest.DXFFileData) }) }); }
/// <summary> /// Ctor /// </summary> /// <param name="analyzer"></param> /// <param name="sequence"></param> public QueryEngine(ITokenAnalyzer <ModelTokenType> analyzer, IQueryable <TokenSequence> input) { if (analyzer == null) { throw new ArgumentNullException("analyzer"); } if (input == null) { throw new ArgumentNullException("values"); } this.Analyzer = analyzer; this.Resolver = analyzer.Settings.Resolver; this.Source = input; }
public string Resolve(object source) { ResolverCache resolverCache; if (resolvers.TryGetValue(source.GetType(), out resolverCache) == false) { var tenantResolverType = typeof(ITenantResolver <>); var tenantResolverTypeGeneric = tenantResolverType.MakeGenericType(source.GetType()); var resolver = serviceProvider.GetRequiredService(tenantResolverTypeGeneric); MethodInfo resolveMethod = tenantResolverTypeGeneric.GetMethod("Resolve"); resolverCache = new ResolverCache(resolver, resolveMethod); resolvers.TryAdd(source.GetType(), resolverCache); } return(resolverCache.GetTenantFrom(source)); }
public void ConfigureManualCache(string cacheDirectory) { this.manualCache = new ResolverCache(cacheDirectory, "Manual"); }
/// <summary> /// Ctor /// </summary> /// <param name="resolverCache"></param> public DataReaderSettings(ResolverCache resolverCache, IEnumerable<IDataFilter<ModelTokenType>> filters) { this.ResolverCache = resolverCache; this.ModelFilters = filters; }
/// <summary> /// Ctor /// </summary> /// <param name="resolverCache"></param> public DataReaderSettings(ResolverCache resolverCache, params IDataFilter<ModelTokenType>[] filters) : this(resolverCache, (IEnumerable<IDataFilter<ModelTokenType>>) filters) { }
/// <summary> /// Ctor /// </summary> /// <param name="resolverCache"></param> public DataReaderSettings(ResolverCache resolverCache, IEnumerable <IDataFilter <ModelTokenType> > filters) { this.ResolverCache = resolverCache; this.ModelFilters = filters; }
/// <summary> /// Ctor /// </summary> /// <param name="resolverCache"></param> public DataReaderSettings(ResolverCache resolverCache, params IDataFilter <ModelTokenType>[] filters) : this(resolverCache, (IEnumerable <IDataFilter <ModelTokenType> >)filters) { }
protected override void _Initialize(Guid key, ResolverCache resolver) { ConsoleAccessor = resolver.FactoryResolver.GetFactory <ConsoleAccessorFactory>().Default(); }