• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IErrorHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IErrorHandler的典型用法代码示例。如果您正苦于以下问题:C# IErrorHandler类的具体用法?C# IErrorHandler怎么用?C# IErrorHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IErrorHandler类属于命名空间,在下文中一共展示了IErrorHandler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: NancyEngine

        /// <summary>
        /// Initializes a new instance of the <see cref="NancyEngine"/> class.
        /// </summary>
        /// <param name="resolver">An <see cref="IRouteResolver"/> instance that will be used to resolve a route, from the modules, that matches the incoming <see cref="Request"/>.</param>
        /// <param name="routeCache">Cache of all available routes</param>
        /// <param name="contextFactory">A factory for creating contexts</param>
        /// <param name="errorHandler">Error handler</param>
        public NancyEngine(IRouteResolver resolver, IRouteCache routeCache, INancyContextFactory contextFactory, IErrorHandler errorHandler)
        {
            if (resolver == null)
            {
                throw new ArgumentNullException("resolver", "The resolver parameter cannot be null.");
            }

            if (routeCache == null)
            {
                throw new ArgumentNullException("routeCache", "The routeCache parameter cannot be null.");
            }

            if (contextFactory == null)
            {
                throw new ArgumentNullException("contextFactory");
            }

            if (errorHandler == null)
            {
                throw new ArgumentNullException("errorHandler");
            }

            this.resolver = resolver;
            this.routeCache = routeCache;
            this.contextFactory = contextFactory;
            this.errorHandler = errorHandler;
        }
开发者ID:nathanpalmer,项目名称:Nancy,代码行数:34,代码来源:NancyEngine.cs


示例2: MetadataImporter

        public MetadataImporter(CompilerOptions options, IErrorHandler errorHandler) {
            Debug.Assert(options != null);
            Debug.Assert(errorHandler != null);

            _options = options;
            _errorHandler = errorHandler;
        }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:MetadataImporter.cs


示例3: Parse

 public virtual void Parse(string code, IErrorHandler errorHandler)
 {
     this._engine.Reset();
     this._errorHandler = errorHandler;
     this._codeBlock.SourceText = code;
     this._engine.CheckForErrors();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:JSCodeSense.cs


示例4: foreach

        bool IParseNodeValidator.Validate(ParseNode node, CompilerOptions options, IErrorHandler errorHandler)
        {
            CompilationUnitNode compilationUnitNode = (CompilationUnitNode)node;

            foreach (AttributeBlockNode attribBlock in compilationUnitNode.Attributes) {
                AttributeNode scriptNamespaceNode = AttributeNode.FindAttribute(attribBlock.Attributes, "ScriptNamespace");
                if (scriptNamespaceNode != null) {
                    string scriptNamespace = (string)((LiteralNode)scriptNamespaceNode.Arguments[0]).Value;

                    if (Utility.IsValidScriptNamespace(scriptNamespace) == false) {
                        errorHandler.ReportError("A script namespace must be a valid script identifier.",
                                                 scriptNamespaceNode.Token.Location);
                    }
                }
            }

            foreach (ParseNode childNode in compilationUnitNode.Members) {
                if (!(childNode is NamespaceNode)) {
                    errorHandler.ReportError("Non-namespaced types are not supported.",
                                             childNode.Token.Location);
                    return false;
                }
            }

            return true;
        }
开发者ID:mobilligy,项目名称:scriptsharp,代码行数:26,代码来源:CompilationUnitNodeValidator.cs


示例5: QuietTextWriter

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="writer">the writer to actually write to</param>
		/// <param name="errorHandler">the error handler to report error to</param>
		/// <remarks>
		/// <para>
		/// Create a new QuietTextWriter using a writer and error handler
		/// </para>
		/// </remarks>
		public QuietTextWriter(TextWriter writer, IErrorHandler errorHandler)
			: base(writer) {
			if (errorHandler == null) {
				throw new ArgumentNullException("errorHandler");
			}
			ErrorHandler = errorHandler;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:17,代码来源:QuietTextWriter.cs


示例6: NancyEngineFixture

        public NancyEngineFixture()
        {
            this.resolver = A.Fake<IRouteResolver>();
            this.response = new Response();
            this.route = new FakeRoute(response);
            this.context = new NancyContext();
            this.errorHandler = A.Fake<IErrorHandler>();
            this.requestDispatcher = A.Fake<IRequestDispatcher>();

            A.CallTo(() => this.requestDispatcher.Dispatch(A<NancyContext>._)).Invokes(x => this.context.Response = new Response());

            A.CallTo(() => errorHandler.HandlesStatusCode(A<HttpStatusCode>.Ignored, A<NancyContext>.Ignored)).Returns(false);

            contextFactory = A.Fake<INancyContextFactory>();
            A.CallTo(() => contextFactory.Create()).Returns(context);

            A.CallTo(() => resolver.Resolve(A<NancyContext>.Ignored)).Returns(new ResolveResult(route, DynamicDictionary.Empty, null, null, null));

            var applicationPipelines = new Pipelines();

            this.routeInvoker = A.Fake<IRouteInvoker>();

            A.CallTo(() => this.routeInvoker.Invoke(A<Route>._, A<DynamicDictionary>._, A<NancyContext>._)).ReturnsLazily(arg =>
            {
                return (Response)((Route)arg.Arguments[0]).Action.Invoke((DynamicDictionary)arg.Arguments[1]);
            });

            this.engine =
                new NancyEngine(this.requestDispatcher, contextFactory, new[] { this.errorHandler }, A.Fake<IRequestTracing>())
                {
                    RequestPipelinesFactory = ctx => applicationPipelines
                };
        }
开发者ID:rhwy,项目名称:Nancy,代码行数:33,代码来源:NancyEngineFixture.cs


示例7: Database

        public Database(ILogger logger, IErrorHandler handler)
        {
            m_logger  = logger;
            m_handler = handler;

            Console.WriteLine("In Database .ctor");
        }
开发者ID:n0name85,项目名称:BonusBits.CodeSamples,代码行数:7,代码来源:Database.cs


示例8:

        bool IParseNodeValidator.Validate(ParseNode node, CompilerOptions options, IErrorHandler errorHandler) {
            NewNode newNode = (NewNode)node;

            // TODO: This is somewhat hacky - it only looks for any type named Dictionary
            //       rather than resolving the type and checking if its actually
            //       System.Dictionary.
            //       This is because validators don't have a reference to the SymbolSet.

            NameNode typeNode = newNode.TypeReference as NameNode;
            if ((typeNode != null) && (typeNode.Name.Equals("Dictionary"))) {
                if (newNode.Arguments != null) {
                    Debug.Assert(newNode.Arguments is ExpressionListNode);
                    ParseNodeList arguments = ((ExpressionListNode)newNode.Arguments).Expressions;

                    if (arguments.Count != 0) {
                        if (arguments.Count % 2 != 0) {
                            errorHandler.ReportError("Missing value parameter for the last name parameter in Dictionary instantiation.",
                                                     newNode.Token.Location);
                        }

                        for (int i = 0; i < arguments.Count; i += 2) {
                            ParseNode nameArgumentNode = arguments[i];
                            if ((nameArgumentNode.NodeType != ParseNodeType.Literal) ||
                                (((LiteralNode)nameArgumentNode).Literal.LiteralType != LiteralTokenType.String)) {
                                errorHandler.ReportError("Name parameters in Dictionary instantiation must be string literals.",
                                                         nameArgumentNode.Token.Location);
                            }
                        }
                    }
                }
            }

            return true;
        }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:34,代码来源:NewNodeValidator.cs


示例9: ErrorHandlingTaskExecutor

 /// <summary>
 /// create a new <see cref="ErrorHandlingTaskExecutor"/> with <paramref name="taskExecutor"/> and
 /// <paramref name="errorHandler"/>
 /// </summary>
 /// <param name="taskExecutor">the task executor</param>
 /// <param name="errorHandler">the error handler in case of an exception</param>
 public ErrorHandlingTaskExecutor(IExecutor taskExecutor, IErrorHandler errorHandler)
 {
     AssertUtils.ArgumentNotNull(taskExecutor, "taskExecutor must not be null");
     AssertUtils.ArgumentNotNull(errorHandler, "errorHandler must not be null");
     _taskExecutor = taskExecutor;
     _errorHandler = errorHandler;
 }
开发者ID:rlxrlxrlx,项目名称:spring-net-integration,代码行数:13,代码来源:ErrorHandlingTaskExecutor.cs


示例10: StaffingResourcePhoneListViewModel

 public StaffingResourcePhoneListViewModel(IDomainUnitOfWorkManager<IDomainUnitOfWork> unitOfWorkManager,
                                           IPartFactory<ItemSelectorViewModel> phoneTypeSelectorFactory,
                                           IErrorHandler errorHandler, IDialogManager dialogManager)
     : base(unitOfWorkManager, errorHandler)
 {
     _phoneTypeSelectorFactory = phoneTypeSelectorFactory;
     _dialogManager = dialogManager;
 }
开发者ID:IdeaBlade,项目名称:Cocktail.AsyncPack,代码行数:8,代码来源:StaffingResourcePhoneListViewModel.cs


示例11: ErrorClientBehavior

 public ErrorClientBehavior(IErrorHandler errorHandler)
 {
     if (errorHandler == null)
     {
         throw new ArgumentNullException();
     }
     _errorHandler = errorHandler;
 }
开发者ID:jcde,项目名称:WCF,代码行数:8,代码来源:ErrorClientBehavior.cs


示例12: ExternalThread

 public ExternalThread(string name, IRuntime runtime, IActorLogger logger, IErrorHandler errorHandler, Action<Action> dispatchMethod)
 {
     _name = name;
     _runtime = runtime;
     _logger = logger;
     _errorHandler = errorHandler;
     _dispatcher = dispatchMethod;
 }
开发者ID:snjee,项目名称:actor-http,代码行数:8,代码来源:ExternalThread.cs


示例13: RequestLifecycleHandler

 /// <summary>Creates a new instance of the RequestLifeCycleHandler class.</summary>
 /// <param name="webContext">The web context wrapper.</param>
 public RequestLifecycleHandler(IWebContext webContext, EventBroker broker, InstallationManager installer, IRequestDispatcher dispatcher, IErrorHandler errors, AdminSection editConfig, HostSection hostConfig)
     : this(webContext, broker, installer, dispatcher, errors)
 {
     checkInstallation = editConfig.Installer.CheckInstallationStatus;
     //installerUrl = editConfig.Installer.InstallUrl;
     rewriteMethod = hostConfig.Web.Rewrite;
     _adminConfig = editConfig;
 }
开发者ID:dpawatts,项目名称:zeus,代码行数:10,代码来源:RequestLifecycleHandler.cs


示例14: StaffingResourceSummaryViewModel

 public StaffingResourceSummaryViewModel(IDomainUnitOfWorkManager<IDomainUnitOfWork> unitOfWorkManager,
                                         IPartFactory<StaffingResourceNameEditorViewModel> nameEditorFactory,
                                         IErrorHandler errorHandler, IDialogManager dialogManager)
     : base(unitOfWorkManager, errorHandler)
 {
     _nameEditorFactory = nameEditorFactory;
     _dialogManager = dialogManager;
 }
开发者ID:IdeaBlade,项目名称:Cocktail.AsyncPack,代码行数:8,代码来源:StaffingResourceSummaryViewModel.cs


示例15: StatementBuilder

        public StatementBuilder(ILocalSymbolTable symbolTable, CodeMemberSymbol memberContext, IErrorHandler errorHandler, CompilerOptions options) {
            _symbolTable = symbolTable;
            _memberContext = memberContext;
            _symbolSet = memberContext.SymbolSet;
            _errorHandler = errorHandler;

            _expressionBuilder = new ExpressionBuilder(symbolTable, memberContext, errorHandler, options);
        }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:8,代码来源:StatementBuilder.cs


示例16: ExpressionBuilder

 public ExpressionBuilder(ILocalSymbolTable symbolTable, FieldSymbol fieldContext, IErrorHandler errorHandler, CompilerOptions options) {
     _symbolTable = symbolTable;
     _symbolContext = fieldContext;
     _classContext = ((ClassSymbol)fieldContext.Parent).PrimaryPartialClass;
     _symbolSet = fieldContext.SymbolSet;
     _errorHandler = errorHandler;
     _options = options;
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:8,代码来源:ExpressionBuilder.cs


示例17: NoneBlockingReceiver

 public NoneBlockingReceiver(
     IQueueEndpointProvider queueEndpointProvider, 
     RabbitMqFactory rabbitMqFactory,
     ChannelConfigurator channelConfigurator,
     IErrorHandler errorHandler)
     : this(queueEndpointProvider, rabbitMqFactory, channelConfigurator, errorHandler, RabbitMqLogger.NullLogger)
 {
 }
开发者ID:swmal,项目名称:RabbitMQUtil,代码行数:8,代码来源:NoneBlockingReceiver.cs


示例18: WorkbenchRefresher

 public WorkbenchRefresher(WorkbenchViewModel viewModel, IAdministrationComponent component, IErrorHandler errorHandler)
 {
     this.ViewModel = viewModel;
     this.Component = component;
     this.Handle = errorHandler;
     this.Scheduler = viewModel.Scheduler;
     Thread.CurrentThread.CurrentUICulture = this.ViewModel.Culture;
 }
开发者ID:seniorOtaka,项目名称:ndoctor,代码行数:8,代码来源:WorkbenchRefresher.cs


示例19: if

        bool IParseNodeValidator.Validate(ParseNode node, CompilerOptions options, IErrorHandler errorHandler)
        {
            MethodDeclarationNode methodNode = (MethodDeclarationNode)node;

            if (((methodNode.Modifiers & Modifiers.Static) == 0) &&
                ((methodNode.Modifiers & Modifiers.New) != 0)) {
                errorHandler.ReportError("The new modifier is not supported on instance members.",
                                         methodNode.Token.Location);
                return false;
            }

            if ((methodNode.Modifiers & Modifiers.Extern) != 0) {
                AttributeNode altSigAttribute
                    = AttributeNode.FindAttribute(methodNode.Attributes, "AlternateSignature");
                if (altSigAttribute == null) {
                    errorHandler.ReportError("Extern methods should only be used to declare alternate signatures and marked with [AlternateSignature].",
                                             methodNode.Token.Location);
                    return false;
                }

                CustomTypeNode typeNode = (CustomTypeNode)methodNode.Parent;
                MethodDeclarationNode implMethodNode = null;

                if (methodNode.NodeType == ParseNodeType.MethodDeclaration) {
                    foreach (MemberNode memberNode in typeNode.Members) {
                        if ((memberNode.NodeType == ParseNodeType.MethodDeclaration) &&
                            ((memberNode.Modifiers & Modifiers.Extern) == 0) &&
                            memberNode.Name.Equals(methodNode.Name, StringComparison.Ordinal)) {
                            implMethodNode = (MethodDeclarationNode)memberNode;
                            break;
                        }
                    }
                }
                else if (methodNode.NodeType == ParseNodeType.ConstructorDeclaration) {
                    foreach (MemberNode memberNode in typeNode.Members) {
                        if ((memberNode.NodeType == ParseNodeType.ConstructorDeclaration) &&
                            ((memberNode.Modifiers & Modifiers.Extern) == 0)) {
                            implMethodNode = (MethodDeclarationNode)memberNode;
                            break;
                        }
                    }
                }

                if (implMethodNode == null) {
                    errorHandler.ReportError("Extern methods used to declare alternate signatures should have a corresponding non-extern implementation as well.",
                                             methodNode.Token.Location);
                    return false;
                }

                if ((methodNode.Modifiers & (Modifiers.Static | Modifiers.AccessMask)) !=
                    (implMethodNode.Modifiers & (Modifiers.Static | Modifiers.AccessMask))) {
                    errorHandler.ReportError("The implemenation method and associated alternate signature methods should have the same access type.",
                                             methodNode.Token.Location);
                }
            }

            return true;
        }
开发者ID:mobilligy,项目名称:scriptsharp,代码行数:58,代码来源:MethodDeclarationNodeValidator.cs


示例20: ErrorHandlerBehavior

 // ────────────────────────── Constructors ──────────────────────────
 public ErrorHandlerBehavior(Type type,
     string unhandledErrorMessage,
     bool returnRawException)
 {
     _errorHandler =
         (IErrorHandler)Activator.CreateInstance(type);
     UnhandledErrorMessage = unhandledErrorMessage;
     ReturnRawException = returnRawException;
 }
开发者ID:richet,项目名称:WcfRestContrib,代码行数:10,代码来源:ErrorHandlerBehavior.cs



注:本文中的IErrorHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IErrorReporter类代码示例发布时间:2022-05-24
下一篇:
C# IErlObject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap