예제 #1
0
        /// <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;
        }
예제 #2
0
        public MetadataImporter(CompilerOptions options, IErrorHandler errorHandler) {
            Debug.Assert(options != null);
            Debug.Assert(errorHandler != null);

            _options = options;
            _errorHandler = errorHandler;
        }
        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;
        }
 public virtual void Parse(string code, IErrorHandler errorHandler)
 {
     this._engine.Reset();
     this._errorHandler = errorHandler;
     this._codeBlock.SourceText = code;
     this._engine.CheckForErrors();
 }
예제 #5
0
        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
                };
        }
예제 #6
0
		/// <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;
		}
예제 #7
0
        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;
        }
 /// <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;
 }
예제 #9
0
        public Database(ILogger logger, IErrorHandler handler)
        {
            m_logger  = logger;
            m_handler = handler;

            Console.WriteLine("In Database .ctor");
        }
예제 #10
0
        protected override void OnStart(string[] args)
        {
           
            try
            {
                base.OnStart(args);
                int delay = 0;
                lock (lockShutdown)
                {
                    hasShutteddown = false;

                    errorHandler = new ErrorHandler(serviceEventLog, lockLog);

                    setInstallationWorkingDirectory();
                    config = CallSelectorFactory.loadISelectorConfig(new FileInfo("CallSelectorConfig.xml"));
                    delay = config.HostRequestDelayMilliseconds();
                    processingThread = new Thread(new ThreadStart(RunProcessing));
                    processingThread.Start();
                }
                lock (lockLog)
                {
                    serviceEventLog.WriteEntry("Start. delay=" + delay + "; " + (config.LogDebug() ? "debug=true" : "debug=false"));
                }
            }
            catch (ThreadAbortException) { /*ignore*/}
            catch (Exception e)
            {
                if (null != errorHandler) errorHandler.handle(e);
            }
            
        }
예제 #11
0
 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;
 }
예제 #12
0
 public NoneBlockingReceiver(
     IQueueEndpointProvider queueEndpointProvider, 
     RabbitMqFactory rabbitMqFactory,
     ChannelConfigurator channelConfigurator,
     IErrorHandler errorHandler)
     : this(queueEndpointProvider, rabbitMqFactory, channelConfigurator, errorHandler, RabbitMqLogger.NullLogger)
 {
 }
 public StaffingResourcePhoneListViewModel(IDomainUnitOfWorkManager<IDomainUnitOfWork> unitOfWorkManager,
                                           IPartFactory<ItemSelectorViewModel> phoneTypeSelectorFactory,
                                           IErrorHandler errorHandler, IDialogManager dialogManager)
     : base(unitOfWorkManager, errorHandler)
 {
     _phoneTypeSelectorFactory = phoneTypeSelectorFactory;
     _dialogManager = dialogManager;
 }
예제 #14
0
 public ErrorClientBehavior(IErrorHandler errorHandler)
 {
     if (errorHandler == null)
     {
         throw new ArgumentNullException();
     }
     _errorHandler = errorHandler;
 }
예제 #15
0
 public ExternalThread(string name, IRuntime runtime, IActorLogger logger, IErrorHandler errorHandler, Action<Action> dispatchMethod)
 {
     _name = name;
     _runtime = runtime;
     _logger = logger;
     _errorHandler = errorHandler;
     _dispatcher = dispatchMethod;
 }
예제 #16
0
 /// <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;
 }
 public StaffingResourceSummaryViewModel(IDomainUnitOfWorkManager<IDomainUnitOfWork> unitOfWorkManager,
                                         IPartFactory<StaffingResourceNameEditorViewModel> nameEditorFactory,
                                         IErrorHandler errorHandler, IDialogManager dialogManager)
     : base(unitOfWorkManager, errorHandler)
 {
     _nameEditorFactory = nameEditorFactory;
     _dialogManager = dialogManager;
 }
예제 #18
0
        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);
        }
예제 #19
0
 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;
 }
        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;
        }
예제 #21
0
파일: Scheduler.cs 프로젝트: spmason/n2cms
 public Scheduler(IEngine engine, IPluginFinder plugins, IHeart heart, IWorker worker, IWebContext context, IErrorHandler errorHandler)
 {
     this.engine = engine;
     actions = new List<ScheduledAction>(InstantiateActions(plugins));
     this.heart = heart;
     this.worker = worker;
     this.context = context;
     this.errorHandler = errorHandler;
 }
예제 #22
0
 // ────────────────────────── Constructors ──────────────────────────
 public ErrorHandlerBehavior(Type type,
     string unhandledErrorMessage,
     bool returnRawException)
 {
     _errorHandler =
         (IErrorHandler)Activator.CreateInstance(type);
     UnhandledErrorMessage = unhandledErrorMessage;
     ReturnRawException = returnRawException;
 }
    public CommunicationHandler(TcpClient serverCon, IErrorHandler error, IInvokable invoke, INotifiable notify, ILobby lobby) {
        _errorHandler = error;
        _tcpClient = serverCon;
        _tcpClient.DataReceived += TcpClient_DataReceived;
        _tcpClient.Disconnected += TcpClient_Disconnnected; 
        _tcpClient.Start();

        _processor = new DataProcessor(invoke, notify, lobby);
    }
예제 #24
0
 public ReceiveListener(
     IQueueEndpointProvider queueEndpointProvider,
     RabbitMqFactory rabbitMqFactory,
     ChannelConfigurator channelConfigurator,
     IErrorHandler errorHandler,
     RabbitMqLogger logger)
     : base(queueEndpointProvider, rabbitMqFactory, channelConfigurator, errorHandler, logger)
 {
 }
예제 #25
0
        public ScriptGenerator(TextWriter writer, CompilerOptions options, IErrorHandler errorHandler) {
            Debug.Assert(writer != null);
            _writer = new ScriptTextWriter(writer, options);

            _options = options;
            _errorHandler = errorHandler;

            _classes = new List<ClassSymbol>();
        }
예제 #26
0
 /// <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)
 {
     this.webContext = webContext;
     this.broker = broker;
     this.errors = errors;
     this.installer = installer;
     this.dispatcher = dispatcher;
     _adminConfig = null;
 }
예제 #27
0
 public DedicatedThread(string name, IRuntime runtime, IActorLogger logger, IErrorHandler errorHandler, int actorId, IActor actor)
 {
     _actor = actor;
     _actorId = actorId;
     _name = name;
     _runtime = runtime;
     _logger = logger;
     _errorHandler = errorHandler;
 }
        public ImportStep(IDataTransferService transferService, ITransferStatisticsFactory statisticsFactory, IErrorHandler errorHandler, IDataTransferModel transferModel)
            : base(transferModel)
        {
            this.transferService = transferService;
            this.statisticsFactory = statisticsFactory;
            this.errorHandler = errorHandler;

            transferModel.Subscribe(m => m.HasImportStarted, OnImportStateChanged);
        }
 public StaffingResourceAddressListViewModel(IDomainUnitOfWorkManager<IDomainUnitOfWork> unitOfWorkManager,
                                             IPartFactory<ItemSelectorViewModel> addressTypeSelectorFactory,
                                             IErrorHandler errorHandler, IDialogManager dialogManager)
     : base(unitOfWorkManager, errorHandler)
 {
     _unitOfWorkManager = unitOfWorkManager;
     _addressTypeSelectorFactory = addressTypeSelectorFactory;
     _dialogManager = dialogManager;
 }
예제 #30
0
        /// <summary>
        /// Constructs the step, using the given transport and settings
        /// </summary>
        public SimpleRetryStrategyStep(SimpleRetryStrategySettings simpleRetryStrategySettings, IErrorTracker errorTracker, IErrorHandler errorHandler)
        {
            if (simpleRetryStrategySettings == null) throw new ArgumentNullException(nameof(simpleRetryStrategySettings));
            if (errorTracker == null) throw new ArgumentNullException(nameof(errorTracker));
            if (errorHandler == null) throw new ArgumentNullException(nameof(errorHandler));

            _simpleRetryStrategySettings = simpleRetryStrategySettings;
            _errorTracker = errorTracker;
            _errorHandler = errorHandler;
        }
예제 #31
0
 protected BaseExecutingCommand(IErrorHandler errorHandler, IAnalyticsService analyticsService)
 {
     ErrorHandler     = errorHandler;
     AnalyticsService = analyticsService;
 }
예제 #32
0
 public ShopController(IShopRepository shopRepository, IErrorHandler errorHandler)
 {
     _shopRepository = shopRepository;
     _errorHandler   = errorHandler;
 }
예제 #33
0
 static CsLox()
 {
     _error_handler = new ConsoleErrorHandler();
     _interpreter   = new Interpreter(_error_handler);
 }
예제 #34
0
 internal RequestObjectHandlerFake(Method method, string path, IErrorHandler errorHandler, RequestHandler0.ObjectHandler0 handler) : base(method, path, new List <IParameterResolver>())
 {
     _executor = (request, mediaTypeMapper1, errorHandler1, logger1) =>
                 RequestObjectExecutor.ExecuteRequest(request, mediaTypeMapper1, handler.Invoke, errorHandler1, logger1);
     _errorHandler = errorHandler;
 }
 public AsyncExecutingCommand(IErrorHandler errorHandler, IAnalyticsService analyticsService)
     : base(errorHandler, analyticsService)
 {
 }
예제 #36
0
        bool IParseNodeValidator.Validate(ParseNode node, CompilerOptions options, IErrorHandler errorHandler)
        {
            string featureName = string.Empty;

            switch (node.NodeType)
            {
            case ParseNodeType.PointerType:
                featureName = "Pointer types";

                break;

            case ParseNodeType.OperatorDeclaration:
                featureName = "Operator overloads";

                break;

            case ParseNodeType.DestructorDeclaration:
                featureName = "Type destructors";

                break;

            case ParseNodeType.Goto:
                featureName = "Goto statements";

                break;

            case ParseNodeType.Lock:
                featureName = "Lock statements";

                break;

            case ParseNodeType.UnsafeStatement:
                featureName = "Unsafe statements";

                break;

            case ParseNodeType.LabeledStatement:
                featureName = "Labeled statements";

                break;

            case ParseNodeType.YieldReturn:
                featureName = "Yield return statements";

                break;

            case ParseNodeType.YieldBreak:
                featureName = "Yield break statements";

                break;

            case ParseNodeType.Checked:
                featureName = "Checked expressions";

                break;

            case ParseNodeType.Unchecked:
                featureName = "Unchecked expressions";

                break;

            case ParseNodeType.Sizeof:
                featureName = "Sizeof expressions";

                break;

            case ParseNodeType.Fixed:
                featureName = "Fixed expressions";

                break;

            case ParseNodeType.StackAlloc:
                featureName = "Stackalloc expressions";

                break;

            case ParseNodeType.DefaultValueExpression:
                featureName = "Default value expressions";

                break;

            case ParseNodeType.ExternAlias:
                featureName = "Extern aliases";

                break;

            case ParseNodeType.AliasQualifiedName:
                featureName = "Alias-qualified identifiers";

                break;

            case ParseNodeType.ConstraintClause:
                featureName = "Generic type constraints";

                break;

            case ParseNodeType.GenericName:
                featureName = "Generic types";

                break;
            }

            errorHandler.ReportUnsupportedFeatureError(featureName, node);

            return(false);
        }
예제 #37
0
 public EncryptCountingQuietTextWriter(string key, TextWriter writer, IErrorHandler errorHandler)
     : base(writer, errorHandler)
 {
     _key = key;
 }
예제 #38
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseViewModel"/> class.
 /// </summary>
 /// <param name="error">Error Handler.</param>
 /// <param name="navigation">Navigation Handler.</param>
 public BaseViewModel(IErrorHandler error, INavigationHandler navigation)
 {
     this.Error      = error;
     this.Navigation = navigation;
 }
예제 #39
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="writer">The <see cref="TextWriter" /> to actually write to.</param>
 /// <param name="errorHandler">The <see cref="IErrorHandler" /> to report errors to.</param>
 /// <remarks>
 /// <para>
 /// Creates a new instance of the <see cref="CountingQuietTextWriter" /> class
 /// with the specified <see cref="TextWriter" /> and <see cref="IErrorHandler" />.
 /// </para>
 /// </remarks>
 public CountingQuietTextWriter(TextWriter writer, IErrorHandler errorHandler) : base(writer, errorHandler)
 {
     m_countBytes = 0;
 }
예제 #40
0
        public static void ReportAssemblyError(this IErrorHandler errorHandler, string assemblyName, string message)
        {
            CompilerError error = new CompilerError((ushort)CompilerErrorCode.AssemblyError, message, assemblyName);

            errorHandler.ReportError(error);
        }
예제 #41
0
 public ErrorBehaviorBase(IErrorHandler errorHandler)
 {
     _errorHandler = errorHandler;
 }
예제 #42
0
 public ProductService(IRepository <TContext, ProductVariation> productVariationRepo, IErrorHandler errorHandler)
 {
     _productVariationRepo = productVariationRepo;
     _errorHandler         = errorHandler;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="RelayCommand" /> class.
        /// </summary>
        /// <param name="execute">The execute.</param>
        /// <param name="canExecute">The can execute.</param>
        /// <param name="errorHandler">The error handler for the asynchronous command.</param>
        /// <exception cref="ArgumentNullException">execute</exception>
        public RelayCommandAsync(Func <Task> execute, Predicate <object> canExecute = null, IErrorHandler errorHandler = null)
        {
            if (execute == null)
            {
                throw new ArgumentNullException(nameof(execute));
            }

            _execute      = execute;
            _canExecute   = canExecute;
            _errorHandler = errorHandler;
        }
예제 #44
0
 public ScriptPreprocessor(IStreamResolver includeResolver, IErrorHandler errorHandler)
 {
     _includeResolver = includeResolver;
     _errorHandler    = errorHandler;
 }
 public ScriptCompiler(IErrorHandler errorHandler)
 {
     _errorHandler = errorHandler;
 }
예제 #46
0
 public EventTreeInfo(string expr, IErrorHandler errorHandler)
     : base(new[] {
     new ExprInfo(expr, null, ParserMode.Event)
 }, errorHandler)
 {
 }
예제 #47
0
 public AsyncCommand(Func <Task> command, IAsyncOperationStatusManager asyncOperationStatusManager, IErrorHandler errorHandler)
 {
     this.errorHandler = errorHandler;
     this.asyncOperationStatusManager = asyncOperationStatusManager ?? throw new ArgumentNullException(nameof(asyncOperationStatusManager));
     this.command = new WeakFunc <Task>(command ?? throw new ArgumentNullException(nameof(command)));
 }
예제 #48
0
 public FileRepositoryStore(IErrorHandler errorHandler)
 {
     _errorHandler = errorHandler;
 }
예제 #49
0
 internal ICompletes <Response> Execute(Request request, IErrorHandler errorHandler, ILogger logger) =>
 _executor.Invoke(request, null, errorHandler, logger);
 public ShareButtonViewModel(IErrorHandler errorHandler)
 {
     _errorHandler    = errorHandler;
     ShareCodeCommand = new Command(ShareCode);
 }
예제 #51
0
 public T UsingErrorHandler(Action <ActorSystem, Exception> generalErrorHandler,
                            Action <ActorSystem, Pid, IMessage, Exception> processErrorHandler)
 {
     _errorHandler = new ErrorHandlerAction(generalErrorHandler, processErrorHandler);
     return((T)this);
 }
예제 #52
0
 public AsyncCommand(Func <Task> execute, Func <bool> canExecute = null, IErrorHandler errorHandler = null)
 {
     this.execute      = execute;
     this.canExecute   = canExecute;
     this.errorHandler = errorHandler;
 }
예제 #53
0
 public T UsingErrorHandler(IErrorHandler errorHandler)
 {
     _errorHandler = errorHandler;
     return((T)this);
 }
예제 #54
0
        bool Initialize(JobSettings settings, IErrorHandler errorHandler)
        {
            this.settings = settings;
            var auditColumns = settings.AuditColumns.AuditColumnNames().Select(c => c.ToLowerInvariant()).ToList();

            if (settings.UseAuditColumnsOnImport ?? false)
            {
                foreach (var field in Fields)
                {
                    if (auditColumns.Contains(field.CanonicalName))
                    {
                        field.IsAuditingColumn = true;
                    }
                }
            }

            if (!Fields.Any())
            {
                errorHandler.Error($"Could not find any information for table {Name}. Make sure it exists in the target database");
                return(false);
            }

            var data = Fields.Select(f => f.Name.ToLowerInvariant());

            if (PrimaryKey == null)
            {
                var primaryKeys = Fields.Where(f => f.IsPrimaryKey).ToList();
                if (primaryKeys.Count == 0)
                {
                    //errorHandler.Warning($"No primary key set for table {Name}, trying to infer from name");
                    primaryKeys = Fields.Where(f => f.Name.ToLowerInvariant() == "id" || f.Name.ToLowerInvariant() == BasicName.ToLowerInvariant() + "id").ToList();
                }
                if (primaryKeys.Count > 1)
                {
                    errorHandler.Error($"Multiple primary keys found for table {Name} ({string.Join(", ", primaryKeys.Select(pk => pk.Name))}). Please specify one manually.");
                    return(false);
                }
                if (!primaryKeys.Any())
                {
                    errorHandler.Error($"No primary key could be found for table {Name}. Please specify one manually");
                    return(false);
                }

                PrimaryKey = primaryKeys.Single().Name;
            }
            PrimaryKey = PrimaryKey.ToLowerInvariant();

            data = data.Where(f => f != PrimaryKey);

            if (settings.UseAuditColumnsOnImport ?? false)
            {
                data = data.Where(f => !settings.AuditColumns.AuditColumnNames().Select(a => a.ToLowerInvariant()).Contains(f));
            }

            if (IsEnvironmentSpecific)
            {
                data = data.Where(f => f != "isenvironmentspecific");
            }

            DataFields = data.ToList();
            return(true);
        }
예제 #55
0
        public static void ReportExpressionError(this IErrorHandler errorHandler, string message, ParseNode node)
        {
            CompilerError error = new CompilerError((ushort)CompilerErrorCode.ExpressionError, message, node.Token.SourcePath, node.Token.Position.Line, node.Token.Position.Column);

            errorHandler.ReportError(error);
        }
예제 #56
0
 public DeclarationStartModel(IApiHttpClient apiHttpClient, IErrorHandler errorHandler)
 {
     this.apiHttpClient = apiHttpClient;
     this.errorHandler  = errorHandler;
 }
예제 #57
0
 public StockQuote(ILogger logger, IErrorHandler handler, IDatabase database)
 {
     _logger   = logger;
     _handler  = handler;
     _database = database;
 }
예제 #58
0
 public ExecutingObservableCommand(IErrorHandler errorHandler, IAnalyticsService analyticsService)
     : base(errorHandler, analyticsService)
 {
 }
예제 #59
0
        void Handle_Clicked_1(object sender, System.EventArgs e)
        {
            IErrorHandler errorHandler = null;

            viewModel.CommandSave.ExecuteAsync().FireAndForgetSafeAsync(errorHandler);
        }
예제 #60
0
 public RequestHandler2 <T, TR> OnError(IErrorHandler errorHandler)
 {
     ErrorHandler = errorHandler;
     return(this);
 }