public BaseLanguageWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) { this.Language = language; this.formatter = formatter; this.exceptionFormatter = exceptionFormatter; this.WriteExceptionsAsComments = writeExceptionsAsComments; }
public ResponseWriter(IExceptionFormatter exceptionformatter) { if (exceptionformatter == null) throw new ArgumentNullException("exceptionFormatter"); Contract.EndContractBlock(); _exceptionformatter = exceptionformatter; }
/// <summary> /// Initializes a new instance of the <see cref="ReadOnlyKernel"/> class. /// </summary> /// <param name="settings">The <see cref="INinjectSettings"/>.</param> /// <param name="bindings">The preconfigured bindings.</param> /// <param name="cache">The <see cref="ICache"/> component.</param> /// <param name="planner">The <see cref="IPlanner"/> component.</param> /// <param name="constructorScorer">The <see cref="IConstructorScorer"/> component.</param> /// <param name="pipeline">The <see cref="IPipeline"/> component.</param> /// <param name="exceptionFormatter">The <see cref="IExceptionFormatter"/> component.</param> /// <param name="bindingPrecedenceComparer">The <see cref="IBindingPrecedenceComparer"/> component.</param> /// <param name="bindingResolvers">The binding resolvers.</param> /// <param name="missingBindingResolvers">The missing binding resolvers.</param> internal ReadOnlyKernel( INinjectSettings settings, Dictionary <Type, ICollection <IBinding> > bindings, ICache cache, IPlanner planner, IConstructorScorer constructorScorer, IPipeline pipeline, IExceptionFormatter exceptionFormatter, IBindingPrecedenceComparer bindingPrecedenceComparer, List <IBindingResolver> bindingResolvers, List <IMissingBindingResolver> missingBindingResolvers) { this.settings = settings; this.bindings = bindings; this.bindingResolvers = bindingResolvers; this.missingBindingResolvers = missingBindingResolvers; this.cache = cache; this.planner = planner; this.constructorScorer = constructorScorer; this.pipeline = pipeline; this.exceptionFormatter = exceptionFormatter; this.bindingPrecedenceComparer = bindingPrecedenceComparer; this.AddReadOnlyKernelBinding <IReadOnlyKernel>(this, bindings); this.AddReadOnlyKernelBinding <IResolutionRoot>(this, bindings); }
public static string Format(this LoggerExtension extension, Exception exception) { Type type = exception.GetType(); IExceptionFormatter formatter = Logger.ExceptionFormatters.ContainsKey(type) ? Logger.ExceptionFormatters[type] : Logger.ExceptionFormatters[typeof(Exception)]; return(formatter.Format(exception)); }
public IntermediateLanguageAssemblyAttributeWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { this.Language = language; this.formatter = formatter; this.exceptionFormatter = exceptionFormatter; this.Settings = settings; }
/// <summary> /// Initializes a new instance of the <see cref="Context"/> class. /// </summary> /// <param name="kernel">The kernel managing the resolution.</param> /// <param name="settings">The ninject settings.</param> /// <param name="request">The context's request.</param> /// <param name="binding">The context's binding.</param> /// <param name="cache">The cache component.</param> /// <param name="planner">The planner component.</param> /// <param name="pipeline">The pipeline component.</param> /// <param name="exceptionFormatter">The <see cref="IExceptionFormatter"/> component.</param> /// <exception cref="ArgumentNullException"><paramref name="kernel"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="settings"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="request"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="binding"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="cache"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="planner"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="pipeline"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="exceptionFormatter"/> is <see langword="null"/>.</exception> public Context(IReadOnlyKernel kernel, INinjectSettings settings, IRequest request, IBinding binding, ICache cache, IPlanner planner, IPipeline pipeline, IExceptionFormatter exceptionFormatter) { Ensure.ArgumentNotNull(kernel, nameof(kernel)); Ensure.ArgumentNotNull(settings, nameof(settings)); Ensure.ArgumentNotNull(request, nameof(request)); Ensure.ArgumentNotNull(binding, nameof(binding)); Ensure.ArgumentNotNull(cache, nameof(cache)); Ensure.ArgumentNotNull(planner, nameof(planner)); Ensure.ArgumentNotNull(pipeline, nameof(pipeline)); Ensure.ArgumentNotNull(exceptionFormatter, nameof(exceptionFormatter)); this.settings = settings; this.Kernel = kernel; this.Request = request; this.Binding = binding; this.Parameters = request.Parameters.Union(binding.Parameters); this.Cache = cache; this.Planner = planner; this.Pipeline = pipeline; this.exceptionFormatter = exceptionFormatter; if (binding.Service.IsGenericTypeDefinition) { this.HasInferredGenericArguments = true; this.GenericArguments = request.Service.GenericTypeArguments; } }
public BaseLanguageWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { this.Language = language; this.formatter = formatter; this.exceptionFormatter = exceptionFormatter; this.Settings = settings; }
public PlainTextEntryFormatter(IExceptionFormatter exceptionFormatter) { if (exceptionFormatter == null) { throw new ArgumentNullException(nameof(exceptionFormatter)); } _exceptionFormatter = exceptionFormatter; }
public IntermediateLanguageAssemblyAttributeWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments, bool shouldGenerateBlocks) { this.Language = language; this.formatter = formatter; this.exceptionFormatter = exceptionFormatter; this.WriteExceptionsAsComments = writeExceptionsAsComments; this.shouldGenerateBlocks = shouldGenerateBlocks; }
public BaseAssemblyAttributeWriter(ILanguage language, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { base(); this.set_Language(language); this.exceptionFormatter = exceptionFormatter; this.set_Settings(settings); return; }
public GenerationSteps(IUserInputProvider userInputProvider, IExecutingPluginAssemblyProvider assemblyProvider, ITools tools, ITimeKeeper timeKeeper, IConsoleWriter consoleWriter, IExceptionFormatter exceptionFormatter) { _userInputProvider = userInputProvider; _assemblyProvider = assemblyProvider; _tools = tools; _timeKeeper = timeKeeper; _consoleWriter = consoleWriter; _exceptionFormatter = exceptionFormatter; }
/// <summary> /// Initializes a new instance of the <see cref="PropertyInjectionStrategy"/> class. /// </summary> /// <param name="injectorFactory">The injector factory component.</param> /// <param name="settings">The ninject settings.</param> /// <param name="exceptionFormatter">The <see cref="IExceptionFormatter"/> component.</param> /// <exception cref="ArgumentNullException"><paramref name="injectorFactory"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="settings"/> is <see langword="null"/>.</exception> /// <exception cref="ArgumentNullException"><paramref name="exceptionFormatter"/> is <see langword="null"/>.</exception> public PropertyInjectionStrategy(IInjectorFactory injectorFactory, INinjectSettings settings, IExceptionFormatter exceptionFormatter) { Ensure.ArgumentNotNull(injectorFactory, nameof(injectorFactory)); Ensure.ArgumentNotNull(settings, nameof(settings)); Ensure.ArgumentNotNull(exceptionFormatter, nameof(exceptionFormatter)); this.injectorFactory = injectorFactory; this.settings = settings; this.exceptionFormatter = exceptionFormatter; }
public BugReporter(string apiKey, IExceptionFormatter exceptionFormatter = null) { _apiKey = apiKey; if (exceptionFormatter == null) { _exceptionFormatter = new DefaultExceptionFormatter(); } else { _exceptionFormatter = exceptionFormatter; } UserAuthorizationCheck = x => true; }
//aynı metodun overload edilmiş hali, kullanıcı isterse parametre olarak //IExceptionformatter' ı kendisi verebilir. public static ExceptionManager getInstance(IExceptionFormatter exceptionFormatter) { if (instance == null) { lock (objectlock) { if (instance == null) { instance = new ExceptionManager(exceptionFormatter); } } } return(instance); }
internal static void HandleApplicationError(HttpContextBase context, IExceptionFormatter exceptionFormatter) { HttpServerUtilityBase httpServerUtility = context.Server; Exception exception = httpServerUtility.GetLastError(); HttpException httpException = exception as HttpException; if (httpException != null) { exceptionFormatter.LogHttpException(context.Request, httpException); } else { exceptionFormatter.LogException(exception); } }
public ContextBenchmark() { var requestParameters = new List <IParameter> { new ConstructorArgument("foo", 5), new ConstructorArgument("boo", 7), new PropertyValue("name", "Tom") }; var bindingParameters = new List <IParameter> { new ConstructorArgument("abc", 2), new ConstructorArgument("def", 1), new PropertyValue("ghi", "Dirk") }; _requestWithParameters = CreateRequest(requestParameters); _requestWithoutParameters = CreateRequest(Array.Empty <IParameter>()); _bindingWithParameters = CreateBinding(bindingParameters); _bindingWithoutParameters = CreateBinding(Array.Empty <IParameter>()); _ninjectSettings = new NinjectSettings { // Disable to reduce memory pressure ActivationCacheDisabled = true, LoadExtensions = false }; _kernelConfiguration = new KernelConfiguration(_ninjectSettings); _kernel = _kernelConfiguration.BuildReadOnlyKernel(); _cache = _kernelConfiguration.Components.Get <ICache>(); _planner = _kernelConfiguration.Components.Get <IPlanner>(); _pipeline = _kernelConfiguration.Components.Get <IPipeline>(); _exceptionFormatter = _kernelConfiguration.Components.Get <IExceptionFormatter>(); _contextWithRequestParameters = CreateContext(_requestWithParameters, _bindingWithoutParameters); _contextWithBindingParameters = CreateContext(_requestWithoutParameters, _bindingWithParameters); _contextWithRequestAndBindingParameters = CreateContext(_requestWithParameters, _bindingWithParameters); _contextWithoutRequestAndBindingParameters = CreateContext(_requestWithoutParameters, _bindingWithoutParameters); }
internal MyReadOnlyKernel(INinjectSettings settings, Dictionary <Type, ICollection <IBinding> > bindings, ICache cache, IPlanner planner, IConstructorScorer constructorScorer, IPipeline pipeline, IExceptionFormatter exceptionFormatter, IBindingPrecedenceComparer bindingPrecedenceComparer, List <IBindingResolver> bindingResolvers, List <IMissingBindingResolver> missingBindingResolvers) : base(settings, bindings, cache, planner, constructorScorer, pipeline, exceptionFormatter, bindingPrecedenceComparer, bindingResolvers, missingBindingResolvers) { }
/// <summary> Creates and configures a new logger. </summary> /// <param name="loggerName"> The name of the logger. </param> /// <param name="exceptionFormatter"> An instance of an exception formatter. </param> /// <param name="logCreation"> Whether to immediately log its creation. </param> public ConfiguredNLogger(ELoggerName loggerName, IExceptionFormatter exceptionFormatter, string subdirectory = "", bool logCreation = false) { ExceptionFormatter = exceptionFormatter; _logger = LogManager.GetLogger(loggerName.ToString()); _messageFormat = "{0} : {1}{2}"; var nlogConfigurationVariables = LogManager.Configuration.Variables; if (loggerName == ELoggerName.FileLogger) { nlogConfigurationVariables[EVariableName.FileName] = @$ "{(string.IsNullOrWhiteSpace(subdirectory) ? " Logs " : subdirectory)}\Log_" + DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss") + ".log"; nlogConfigurationVariables[EVariableName.FileLayout] = "${longdate:format=yyyy/MM/dd_HH:mm:ss} ${level:upperCase=true} / ${message}"; } else if (loggerName == ELoggerName.ConsoleLogger) { nlogConfigurationVariables[EVariableName.ConsoleLayout] = "${time} ${level:upperCase=true} / ${message}"; } if (logCreation) { LogInstantiation(this); } }
public BaseImperativeLanguageWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) : base(language, formatter, exceptionFormatter, writeExceptionsAsComments) { this.KeyWordWriter = CreateKeyWordWriter(); }
public NamespaceImperativeLanguageWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) : base(language, formatter, exceptionFormatter, writeExceptionsAsComments) { writeNamespacesandUsings = false; writeFullyQualifiedNames = false; }
public override IAssemblyAttributeWriter GetAssemblyAttributeWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) { return new VisualBasicAssemblyAttributeWriter(this, formatter, exceptionFormatter, writeExceptionsAsComments); }
public IntermediateLanguageAttributeWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments, bool shouldGenerateBlocks) : base(language, formatter, exceptionFormatter, writeExceptionsAsComments, shouldGenerateBlocks) { }
public abstract IAssemblyAttributeWriter GetAssemblyAttributeWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments);
/// <summary> /// 构造函数 /// </summary> protected internal HttpWebExceptionHandler(ILogService logService, IExceptionFormatter exceptionFormatter) : base(logService, exceptionFormatter) { }
public override IAssemblyAttributeWriter GetAssemblyAttributeWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { return(new CSharpAssemblyAttributeWriter(this, formatter, exceptionFormatter, settings)); }
public HttpErrorFilter(IExceptionFormatter exceptionFormatter) { _exceptionFormatter = exceptionFormatter; }
public override ILanguageWriter GetWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) { return new IntermediateLanguageWriter(this, formatter, exceptionFormatter, writeExceptionsAsComments, ShouldGenerateBlocks); }
public CSharpAssemblyAttributeWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) : base(language, exceptionFormatter, settings) { this.writer = new CSharpAssemblyAttributeInternalWriter(language, formatter, exceptionFormatter, settings); this.writer.ExceptionThrown += OnExceptionThrown; }
public override ILanguageWriter GetWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { return new VisualBasicWriter(this, formatter, exceptionFormatter, settings); }
public override IAssemblyAttributeWriter GetAssemblyAttributeWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { return new VisualBasicAssemblyAttributeWriter(this, formatter, exceptionFormatter, settings); }
public VisualBasicWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) : base(language, formatter, exceptionFormatter, writeExceptionsAsComments) { }
public CSharpAssemblyAttributeInternalWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) : base(language, formatter, exceptionFormatter, settings) { }
/// <summary> /// 构造函数 /// </summary> /// <param name="logService">日志记录器</param> /// <param name="exceptionFormatter">信息收集格式化接口</param> protected internal ExceptionHandler(ILogService logService, IExceptionFormatter exceptionFormatter) { this.LogService = logService; this.exceptionFormatter = exceptionFormatter; }
public abstract IAssemblyAttributeWriter GetAssemblyAttributeWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings);
public abstract ILanguageWriter GetWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings);
public BaseAssemblyAttributeWriter(ILanguage language, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) { this.Language = language; this.exceptionFormatter = exceptionFormatter; this.WriteExceptionsAsComments = writeExceptionsAsComments; }
public override ILanguageWriter GetWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { return new IntermediateLanguageWriter(this, formatter, exceptionFormatter, settings); }
public VisualBasicAssemblyAttributeWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) : base(language, exceptionFormatter, writeExceptionsAsComments) { this.writer = new VisualBasicAssemblyAttributeInternalWriter(language, formatter, exceptionFormatter, writeExceptionsAsComments); this.writer.ExceptionThrown += OnExceptionThrown; }
public abstract ILanguageWriter GetWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments);
public VisualBasicAssemblyAttributeInternalWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) : base(language, formatter, exceptionFormatter, writeExceptionsAsComments) { }
public LoggerProxyOptions WithExceptionFormatter(IExceptionFormatter customExceptionFormatter) { ExceptionFormatter = customExceptionFormatter; return(this); }
public IntermediateLanguageWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments, bool shouldGenerateBlocks) : base(language, formatter, exceptionFormatter, writeExceptionsAsComments) { this.shouldGenerateBlocks = shouldGenerateBlocks; this.flagsWriter = new FlagsWriter(this); }
public override ILanguageWriter GetWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) { return new VisualBasicWriter(this, formatter, exceptionFormatter, writeExceptionsAsComments); }
public NamespaceImperativeLanguageWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { base(language, formatter, exceptionFormatter, settings); this.writeNamespacesandUsings = false; return; }
public CSharpAssemblyAttributeWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) : base(language, exceptionFormatter, writeExceptionsAsComments) { this.writer = new CSharpAssemblyAttributeInternalWriter(language, formatter, exceptionFormatter, writeExceptionsAsComments); }
public NamespaceImperativeLanguageWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) : base(language, formatter, exceptionFormatter, settings) { writeNamespacesandUsings = false; }
public BaseImperativeLanguageWriter(ILanguage language, IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) : base(language, formatter, exceptionFormatter, settings) { this.KeyWordWriter = CreateKeyWordWriter(); }
public override ILanguageWriter GetWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, IWriterSettings settings) { return(new CSharpWriter(this, formatter, exceptionFormatter, settings)); }
public override ILanguageWriter GetWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) { return(new CSharpWriter(this, formatter, exceptionFormatter, writeExceptionsAsComments)); }
public override IAssemblyAttributeWriter GetAssemblyAttributeWriter(IFormatter formatter, IExceptionFormatter exceptionFormatter, bool writeExceptionsAsComments) { return(new CSharpAssemblyAttributeWriter(this, formatter, exceptionFormatter, writeExceptionsAsComments)); }
/// <summary> /// Initializes a new instance of the <see cref="ExceptionFormatterFactory"/> class. /// </summary> /// <param name="builders">The builders.</param> public ExceptionFormatterFactory(IExceptionFormatterBuilder[] builders) { builders = builders ?? new IExceptionFormatterBuilder[0]; _defaultExceptionFormatter = new TextExceptionFormatter(this); _builders = new FunctionKeyedCollection<Type, IExceptionFormatterBuilder>(x => x.BaseExceptionType, builders); }