private static CilDocumentSyntax Build(
     IDerivedBuilder<CilDocumentSyntax> builder,
     ILogging logging,
     CilDocumentSyntax context)
 {
     return builder.Build(logging, context);
 }
Пример #2
0
        public Grammar Read(IGrammarSource source, ILogging logging)
        {
            var cilSource = source as CilGrammarSource;
            if (cilSource == null)
            {
                return null;
            }

            this.logging = logging;

            CilGrammar definition = null;

            logging.WithTimeLogging(
                cilSource.LanguageName,
                cilSource.Origin,
                () =>
                {
                    definition = new CilGrammar(cilSource, logging);
                },
                "parsing language definition");

            if (definition == null || !definition.IsValid)
            {
                return null;
            }

            var grammar = BuildGrammar(definition);

            grammar.Options = (IronText.Reflection.RuntimeOptions)Attributes.First<LanguageAttribute>(cilSource.DefinitionType).Flags;
            return grammar;
        }
Пример #3
0
 public TryToGetOp(TimeSpan sleepTimeBetweenChecks, IMessagingClient messageClient, IConfiguration configuration, ILogging logging)
 {
     _sleepTimeBetweenChecks = sleepTimeBetweenChecks;
     _messageClient = messageClient;
     _clientConfiguration = configuration.LoadClientConfiguration();
     _logging = logging;
 }
Пример #4
0
 private static void StartOpGetterThread(IMessagingClient client, IConfiguration configuration, ILogging logging)
 {
     // Zusätzlichen Thread starten, der regelmäßig prüft, ob der TopicBot OP hat, und falls nicht, den Channel verlässt und neu beitritt,
     // sobald er der einzige User im Channel ist (um so OP zu bekommen)
     var opGetter = new TopicBotBehaviour.TryToGetOp(new TimeSpan(0, 3, 0), client, configuration, logging);
     new Thread(new ThreadStart(opGetter.CheckIfOpAndTryToGetOpIfNotLoop)).Start();
 }
        public ExcelProject LoadStructureExcel(string pathFolder, ILogging logging)
        {
            var docFilesGetter = new ExcelDocsFilesNameGetter {LocationDirectory = pathFolder};

            var siemensProjectLoader = new ExcelProjectLoader(docFilesGetter, logging);

            return siemensProjectLoader.LoadStructureProject();
        }
 // Constructor.
 // 'clientAppPublicId' must specify the public identifier of the client application.
 // 'clientAppSecret' must specify the client application's secret.
 // 'tokenEndpointUri' must specify the URI of the OAuth2 Server's token endpoint.
 // 'logging' must specify an implementation of ILogging.
 public OAuth2ServerAccess(String clientAppPublicId, String clientAppSecret, String tokenEndpointUri,
     ILogging logging)
 {
     this._clientAppPublicId = clientAppPublicId;
     this._clientAppSecret = clientAppSecret;
     this._tokenEndpointUri = tokenEndpointUri;
     this._logging = logging;
 }
	    /// <summary>
	    ///		Constructor
	    /// </summary>
	    public FilesystemConfigurationLoader(ILogging logging)
	    {
	        this.logging = logging;
	        this.configPath = 
					Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) +
	        Path.DirectorySeparatorChar +
	        "etc";
	    }
        public override bool Validate(ILogging logging)
        {
            isValid =
                ValidateAllGenericArgsAreUsed(Method.GetGenericArguments().ToList(), Method.ReturnType, logging)
                &&
                base.Validate(logging);

            return isValid;
        }
Пример #9
0
        public Game(IServer server, ILogging log)
        {
            this.server = server;
            this.log = log;

            server.NewSession += Server_NewSession;

            this.commands.Add("QUIT", new QuitCommand());
        }
Пример #10
0
 public Standart CreateStandartByDrawing(ILogging log)
 {
     var helper = new DrawingsToStandartHelper();
     var hierDataManager = _dataManagersFactory.GetDrawingsHierClassDataManager();
     var gmGost = _dataManagersFactory.GetDataManager<Gost>();
     helper.Log = log;
     var standart = helper.CreateStandartByDrawing(_drawing, hierDataManager, gmGost.GetListCollection());
     return standart;
 }
Пример #11
0
        public Interpreter(object context, ILanguageRuntime language)
        {
            this.language = language;
            this.context = context;
            this.logging = new MemoryLogging();

            // Default behavior
            this.LoggingKind = LoggingKind.ThrowOnError;
        }
Пример #12
0
        public ScanDataCollector(IEnumerable<CilSymbolRef> terminals, ILogging logging)
        {
            this.logging = logging;
            this.validMetadata   = new List<ICilMetadata>();
            this.invalidMetadata = new List<ICilMetadata>();
            this.conditions      = new List<CilCondition>();
            this.terminals       = new List<CilSymbolRef>(terminals);

            processedConditions = new Stack<CilCondition>();
        }
Пример #13
0
        public CrmHelper(ICrmService crmService, ILogging logging, ICrmResourceStrings crmResourceStrings)
        {
            if (crmService == null) throw new ArgumentNullException("crmService");
            if (logging == null) throw new ArgumentNullException("logging");
            _crmService = crmService;
            _logging = logging;
            _crmResourceStrings = crmResourceStrings;

            _logging.Write(GetString("LoggingCrmHelperCreated", "Created CrmHelper"));
        }
 public Standart CreateStandartByDrawingByClearWeights(ILogging log, double koefList, double koefSort)
 {
     var helper = new DrawingsToStandartByWeigthsHelper
     {
         Log = log,
         WasteSortKoefficient = koefSort,
         WasteKoefficient = koefList
     };
     return GetStandartByDrawing(helper);
 }
Пример #15
0
        public SiemensProject LoadStructureSiemens(string pathFolder, ILogging logging)
        {
            var filesNameGetter = new SiemensXmlDataFilesNameGetter { LocationDirectory = pathFolder };

            var docFilesGetter = new SiemensDocsFilesNameGetter { LocationDirectory = pathFolder };

            var filesArticlesFactory = new FilesArticlesFactory(filesNameGetter);
            var siemensProjectLoader = new SiemensProjectLoader(filesArticlesFactory, logging, docFilesGetter);

            return siemensProjectLoader.LoadStructureProject();
        }
Пример #16
0
        public static ScannerDescriptor FromScanRules(IEnumerable<Matcher> matchers, ILogging logging)
        {
            CheckAllRulesHaveIndex(matchers);

            var result = new ScannerDescriptor(logging);
            foreach (var matcher in matchers)
            {
                result.AddRule(matcher);
            }

            return result;
        }
Пример #17
0
        public TempDrawingsStorage ConvertSiemensToDrawings(SiemensProject project, ILogging logger)
        {
            var converter = new ConverterSiemensProject(logger);
            var parser = _dataImportToolsFactory.GetMaterialParser();
            var excluder = _dataImportToolsFactory.GetProjectExcluder();
            var searcher = _dataImportToolsFactory.GetNameMaterialSearch();
            var normalizer = _dataImportToolsFactory.GetFieldsNormalizer();
            converter.ExcluderProject = excluder;
            converter.Log = logger;
            converter.MaterialParser = parser;
            converter.NameMaterialSearch = searcher;
            converter.Normalizer = normalizer;

            return converter.ConvertSiemensProjectToDomainModel(project);
        }
Пример #18
0
        public override bool Validate(ILogging logging)
        {
            if (string.IsNullOrEmpty(LiteralText))
            {
                logging.Write(
                    new LogEntry
                    {
                        Severity = Severity.Error,
                        Message = "Literal cannot be null or empty string.",
                        Origin = ReflectionUtils.ToString(this.Member)
                    });
                return false;
            }

            return base.Validate(logging);
        }
        public TempDrawingsStorage ConvertExcelToDrawings(ExcelProject project, ILogging logger)
        {
            var converter = new ConverterExcelProject(logger);
            var parser = _toolsFactory.GetExcelMaterialParser();
            var excluder = _toolsFactory.GetProjectExcluder();
            var searcher = _toolsFactory.GetNameMaterialSearch();
            var normalizer = _toolsFactory.GetExcelFieldsNormalizer();
            var standartizer = _toolsFactory.GetStandartizez();
            converter.DrawingExcluder = excluder;
            converter.Log = logger;
            converter.ExcelMaterialParser = parser;
            converter.NameMaterialSearch = searcher;
            converter.Normalizer = normalizer;
            converter.DrawingStandartezer = standartizer;

            return converter.ConvertExcelProjectToDomainModel(project);
        }
Пример #20
0
 public static void SetLogger(ILogging logger)
 {
     _isInitialised = false;
     PreStartInitialise(logger);
 }
Пример #21
0
 public RemoteLogging(ILogging logging)
 {
     _logging = logging;
 }
Пример #22
0
 public DistributedCacheFactoryBase()
 {
     _logger = new Logger();
     _config = new CacheConfig();
 }
Пример #23
0
 public DummyTCOnly(string urn, ITimeProvider timeProvider, ILogging logging) : base(urn, Type, timeProvider, logging)
 {
 }
 public HomeController(ISessionStateAccess sessionState, IAppSettingsAccess appSettings,
     IOAuth2ServerAccess oauth2Server, IWebApiAccess webApi, IResourcesAccess resources, ILogging logging,
     IGlobalStateAccess globalState)
     : base(sessionState, appSettings, oauth2Server, webApi, resources, logging, globalState)
 {
 }
Пример #25
0
 /// <summary>DbExecutionStrategy implemenentation that specifies 'max retry count' and 'max delay' values.</summary>
 /// <param name="maxRetryCount">Maximum number of retry attempts.</param>
 /// <param name="maxdelay">Maximum delay (in milliseconds) between retry attempts.</param>
 /// <param name="logger">Object that implements the ILogging interface.</param>
 public MsSqlServerEfCfExecutionStrategy(int maxRetryCount, TimeSpan maxdelay, ILogging logger = null) : base(maxRetryCount, maxdelay, logger)
 {
 }
        private bool ValidateAllGenericArgsAreUsed(
            List<Type> usedTypes,
            Type       compositeType,
            ILogging   logging)
        {
            DeleteUsedGenericArgs(usedTypes, compositeType, logging);
            if (usedTypes.Count != 0)
            {
                logging.Write(
                    new LogEntry
                    {
                        Severity = Severity.Error,
                        Message  = "One or more generic arguments cannot be deduced from the method result type.",
                        Origin   = ReflectionUtils.ToString(Method)
                    });
                return false;
            }

            return true;
        }
Пример #27
0
 public BankAccount(string accountId, ILogging logging, IBank bank)
 {
     m_logging = logging;
     m_bank = bank;
     AccountId = accountId;
 }
 public FinancialController(ILogging logging)
 {
     _logging = logging;
 }
Пример #29
0
 protected void StopTrackTimeAndLog(Stopwatch watch, ILogging logger)
 {
     watch.Stop();
     logger.Trace($"Time: {watch.ElapsedMilliseconds}");
 }
Пример #30
0
 ///// <summary>Note: Default 'max retry' count = 5 (total time spent between retries is approximately 26 seconds, plus the 'random' factor: min(random(1, 1.1) * (2 ^ retryCount - 1), maxDelay)).</summary>
 ///// <param name="logger">Object that implements the ILogging interface.</param>
 ///// <remarks>Relevant info: https://msdn.microsoft.com/en-us/library/system.data.entity.infrastructure.dbexecutionstrategy(v=vs.113).aspx </remarks>
 public MsSqlServerEfCfExecutionStrategy(ILogging logger = null) : base(logger)
 {
 }
Пример #31
0
 public bool Logging(ILogging log)
 {
     return log.Logging();
 }
 public FilerViewModel(IMvxNavigationService navigationService, IIOStorageService storageService, IFilerWebHandler filerWebHandler, ILogging logging)
 {
     this.NavigationService = navigationService;
     this.storageService    = storageService;
     this.filerWebHandler   = filerWebHandler;
     this.logging           = logging;
 }
Пример #33
0
 public static void SetLogger(ILogging logger)
 {
     lock (LoggingLock)
         Logging = logger;
 }
 private static void DeleteUsedGenericArgs(
     List<Type> usedTypes,
     Type type,
     ILogging logging)
 {
     if (type.IsGenericParameter)
     {
         usedTypes.Remove(type);
     }
     else if (type.ContainsGenericParameters)
     {
         if (type.IsArray)
         {
             DeleteUsedGenericArgs(usedTypes, type.GetElementType(), logging);
         }
         else
         {
             foreach (var paramType in type.GetGenericArguments())
             {
                 DeleteUsedGenericArgs(usedTypes, paramType, logging);
             }
         }
     }
 }
Пример #35
0
 public DataCurveComputationHandler(ILogging logging)
 {
     _logging = logging;
 }
Пример #36
0
 public ContactService(IContactRepository contactRepository, IHttpClient httpClient, ILogging logger, ICustomerRepository customerRepository, IVoidRepository voidRepository)
 {
     _contactRepository  = contactRepository;
     _httpClient         = httpClient;
     _logger             = logger;
     _customerRepository = customerRepository;
     _voidRepository     = voidRepository;
     _allocationApiUrl   = WebConfigurationManager.AppSettings["AllocationApiUrl"];
 }
Пример #37
0
 public ConverterSiemensProject(ILogging log)
 {
     Log = log;
 }
        // Initializes global state.
        // 'webApiSegmentsTreeMeasuresUri' must specify the Web API URI that returns information about the requestable
        // measures from the Segments Tree Node resource.
        // 'exportCultureNames' must specify the names (e.g. "en-US") of the cultures that can be used when
        // exporting data (e.g. CSV data); can be null/empty.  The culture names must be separated by spaces.
        // Throws an exception and logs an error in the event of error.
        public async static void Init(Uri webApiSegmentsTreeMeasuresUri, String exportCultureNames,
            ILogging logging)
        {
            if (webApiSegmentsTreeMeasuresUri == null)
                throw new ArgumentNullException("webApiSegmentsTreeMeasuresUri");


            // Get information about the Segments Tree Node measures.
            // NOTE: the Segments Tree Node measures (as opposed to the Time Series measures) can grow from time
            // to time (from sprint to sprint), so we pull down the latest list whenever the app starts up.
            String measuresXml = String.Empty;
            HttpClient httpClient = null;
            try
            {
                httpClient = new HttpClient();
                httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
                var response = await httpClient.GetAsync(webApiSegmentsTreeMeasuresUri);
                response.EnsureSuccessStatusCode();
                measuresXml = await response.Content.ReadAsStringAsync();
            }
            catch (Exception ex)
            {
                // Log the error.
                var errorMessage = "Failed to get information about the Segments Tree Node measures from " +
                                   "the Web API.  " + ex.ToString();
                System.Diagnostics.Debug.WriteLine(errorMessage);
                if (logging != null)
                    logging.LogError(errorMessage);

                throw;
            }
            finally
            {
                if (httpClient != null)
                    httpClient.Dispose();
            }


            // Parse the measures info XML, and store the resulting collection in '_segmentsTreeMeasures'.
            try
            {
                var doc = XDocument.Parse(measuresXml);
                XNamespace ns = "http://statpro.com/2012/Revolution";
                _segmentsTreeMeasures = doc.Root
                                           .Element(ns + "measures").Elements(ns + "measure")
                                           .Select(me => new MeasureInfo(me, ns))
                                           .ToList().AsReadOnly();
            }
            catch (Exception ex)
            {
                // Log the error.
                var errorMessage = "Failed to parse the information about the Segments Tree Node measures that " +
                                   "was returned by the Web API.  " + ex.ToString();
                System.Diagnostics.Debug.WriteLine(errorMessage);
                if (logging != null)
                    logging.LogError(errorMessage);

                throw;
            }


            // Derive a separate collection of the named categories into which the Segments Tree Node measures
            // fall.
            _segmentsTreeMeasureCategories = _segmentsTreeMeasures.Select(mi => mi.Category)
                                                                  .Distinct()
                                                                  .OrderBy(c => c)
                                                                  .ToList().AsReadOnly();


            // Set up the collection of export cultures.  Unrecognised culture names are ignored.
            if (String.IsNullOrWhiteSpace(exportCultureNames))
            {
                _exportCultures = new List<CultureInfo>().AsReadOnly();
                return;
            }

            Func<String, CultureInfo> getCultureOrNull = name => 
                { try { return new CultureInfo(name); } catch (CultureNotFoundException) { return null; } };

            _exportCultures = exportCultureNames.Split(' ')
                                                .Select(name => getCultureOrNull(name))
                                                .Where(ci => ci != null)
                                                .OrderBy(ci => ci.DisplayName)
                                                .ToList().AsReadOnly();
        }
Пример #39
0
 public DistributedCacheFactoryBase(ILogging logger, CacheConfig config)
 {
     _logger = logger;
     _config = config ?? new CacheConfig();
 }
 public virtual bool Validate(ILogging logging)
 {
     return true;
 }
 public SqlBulkCopyAction(IOptions options, IConfiguration configuration, ILogging logging, ITestMetricManager testMetricManager)
     : base(options, configuration, logging, testMetricManager)
 {
     ClientProcess = (monitor, clientNumber, token) => InternalClientProcess(monitor, clientNumber, token);
 }
Пример #42
0
 public static void addLogging(ILogging l)
 {
     if (!_l.Contains(l)) Logging._l.Add(l);
 }
Пример #43
0
 protected void StartTest(out Stopwatch watch, out ILogging logger, [CallerMemberName] string testName = "test")
 {
     watch  = new Stopwatch();
     logger = LogHelper.GetLogger(testName);
     logger.Trace("Starting test");
 }