Ejemplo n.º 1
0
        private static IntegrationOptions GetOptions(DTE dte)
        {
            var options = cachedOptions;

            if (options != null)
            {
                return(options);
            }

            int maxStepInstancesSuggestions;

            options = new IntegrationOptions
            {
                EnableSyntaxColoring          = GetGeneralOption(dte, "EnableSyntaxColoring", EnableSyntaxColoringDefaultValue),
                EnableOutlining               = GetGeneralOption(dte, "EnableOutlining", EnableOutliningDefaultValue),
                EnableIntelliSense            = GetGeneralOption(dte, "EnableIntelliSense", EnableIntelliSenseDefaultValue),
                LimitStepInstancesSuggestions = int.TryParse(GetGeneralOption(dte, "MaxStepInstancesSuggestions", MaxStepInstancesSuggestionsDefaultValue), out maxStepInstancesSuggestions),
                MaxStepInstancesSuggestions   = maxStepInstancesSuggestions,
                EnableAnalysis          = GetGeneralOption(dte, "EnableAnalysis", EnableAnalysisDefaultValue),
                EnableTableAutoFormat   = GetGeneralOption(dte, "EnableTableAutoFormat", EnableTableAutoFormatDefaultValue),
                EnableStepMatchColoring = GetGeneralOption(dte, "EnableStepMatchColoring", EnableStepMatchColoringDefaultValue),
                EnableTracing           = GetGeneralOption(dte, "EnableTracing", EnableTracingDefaultValue),
                TracingCategories       = GetGeneralOption(dte, "TracingCategories", TracingCategoriesDefaultValue),
                DisableRegenerateFeatureFilePopupOnConfigChange = GetGeneralOption(dte, "DisableRegenerateFeatureFilePopupOnConfigChange", DisableRegenerateFeatureFilePopupOnConfigChangeDefaultValue),
                GenerationMode = GetGeneralOption(dte, "GenerationMode", GenerationModeDefaultValue),
                CodeBehindFileGeneratorPath         = GetGeneralOption(dte, "PathToCodeBehindGeneratorExe", CodeBehindFileGeneratorPath),
                CodeBehindFileGeneratorExchangePath = GetGeneralOption(dte, "CodeBehindFileGeneratorExchangePath", CodeBehindFileGeneratorExchangePath),
                OptOutDataCollection = GetGeneralOption(dte, "OptOutDataCollection", DefaultOptOutDataCollection)
            };
            cachedOptions = options;
            return(options);
        }
Ejemplo n.º 2
0
        private static IntegrationOptions GetOptions(DTE dte)
        {
            var options = cachedOptions;

            if (options != null)
            {
                return(options);
            }

            options = new IntegrationOptions
            {
                EnableSyntaxColoring    = GetGeneralOption(dte, "EnableSyntaxColoring", EnableSyntaxColoringDefaultValue),
                EnableOutlining         = GetGeneralOption(dte, "EnableOutlining", EnableOutliningDefaultValue),
                EnableIntelliSense      = GetGeneralOption(dte, "EnableIntelliSense", EnableIntelliSenseDefaultValue),
                EnableAnalysis          = GetGeneralOption(dte, "EnableAnalysis", EnableAnalysisDefaultValue),
                EnableTableAutoFormat   = GetGeneralOption(dte, "EnableTableAutoFormat", EnableTableAutoFormatDefaultValue),
                EnableStepMatchColoring = GetGeneralOption(dte, "EnableStepMatchColoring", EnableStepMatchColoringDefaultValue),
                EnableTracing           = GetGeneralOption(dte, "EnableTracing", EnableTracingDefaultValue),
                TracingCategories       = GetGeneralOption(dte, "TracingCategories", TracingCategoriesDefaultValue),
                TestRunnerTool          = GetGeneralOption(dte, "TestRunnerTool", TestRunnerToolDefaultValue),
                DisableRegenerateFeatureFilePopupOnConfigChange = GetGeneralOption(dte, "DisableRegenerateFeatureFilePopupOnConfigChange", DisableRegenerateFeatureFilePopupOnConfigChangeDefaultValue),
                GenerationMode = GetGeneralOption(dte, "GenerationMode", GenerationModeDefaultValue),
                CodeBehindFileGeneratorPath         = GetGeneralOption(dte, "PathToCodeBehindGeneratorExe", CodeBehindFileGeneratorPath),
                CodeBehindFileGeneratorExchangePath = GetGeneralOption(dte, "CodeBehindFileGeneratorExchangePath", CodeBehindFileGeneratorExchangePath)
            };
            cachedOptions = options;
            return(options);
        }
        public static CallTargetState BeginMethod <TIntegration, TTarget, TArg1, TArg2>(TTarget instance, TArg1 arg1, TArg2 arg2)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(BeginMethodHandler <TIntegration, TTarget, TArg1, TArg2> .Invoke(instance, ref arg1, ref arg2));
            }

            return(CallTargetState.GetDefault());
        }
        public static CallTargetState BeginMethod <TIntegration, TTarget, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(TTarget instance, ref TArg1 arg1, ref TArg2 arg2, ref TArg3 arg3, ref TArg4 arg4, ref TArg5 arg5, ref TArg6 arg6, ref TArg7 arg7, ref TArg8 arg8)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(BeginMethodHandler <TIntegration, TTarget, TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8> .Invoke(instance, ref arg1, ref arg2, ref arg3, ref arg4, ref arg5, ref arg6, ref arg7, ref arg8));
            }

            return(CallTargetState.GetDefault());
        }
        public static CallTargetReturn EndMethod <TIntegration, TTarget>(TTarget instance, Exception exception, CallTargetState state)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(EndMethodHandler <TIntegration, TTarget> .Invoke(instance, exception, in state));
            }

            return(CallTargetReturn.GetDefault());
        }
        public static CallTargetReturn <TReturn> EndMethod <TIntegration, TTarget, TReturn>(TTarget instance, TReturn returnValue, Exception exception, CallTargetState state)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(EndMethodHandler <TIntegration, TTarget, TReturn> .Invoke(instance, returnValue, exception, in state));
            }

            return(new CallTargetReturn <TReturn>(returnValue));
        }
        public static CallTargetState BeginMethod <TIntegration, TTarget>(TTarget instance, object[] arguments)
        {
            if (IntegrationOptions <TIntegration, TTarget> .IsIntegrationEnabled)
            {
                IntegrationOptions <TIntegration, TTarget> .RecordTelemetry();

                return(BeginMethodSlowHandler <TIntegration, TTarget> .Invoke(instance, arguments));
            }

            return(CallTargetState.GetDefault());
        }
        //=====================================================================
        // Class Constructor
        //=====================================================================
        /// <summary>
        /// Set the address of the luminosity sensor and set the clock speed
        /// </summary>
        public TSL2561BusSensor() : base(BUS_ADDRESS, CLOCK_SPEED)
        {
            // Determine the current timing settings
            byte command = (byte)CommandOptions.CommandBit | (byte)Registers.Timing;

            byte[] options = new byte[1];               // Will hold registry values
            ReadRegister(command, options);

            // Determine the timing settings
            _gain      = (GainOptions)(options[0] & (byte)GainOptions.High);
            _intPeriod = (IntegrationOptions)(options[0] & 0x03);
        }
Ejemplo n.º 9
0
 public HRSEmployeeRepository(IOptions <IntegrationOptions> integrationConfiguration, IConfiguration configuration, IDistributedCache distributedCache)
 {
     this.distributedCache = distributedCache;
     if (integrationConfiguration == null)
     {
         throw new ArgumentNullException(nameof(integrationConfiguration));
     }
     this.integrationConfiguration = integrationConfiguration.Value;
     CacheEnabled = bool.Parse(configuration["Cache:Enabled"]);
     options      = new DistributedCacheEntryOptions();
     options.AbsoluteExpirationRelativeToNow = TimeSpan.FromDays(1);
 }
Ejemplo n.º 10
0
        //=====================================================================
        // SetTiming
        //=====================================================================
        public void SetTiming(GainOptions gain, IntegrationOptions integration)
        {
            // Set the commands
            byte command = (byte)CommandOptions.CommandBit | (byte)Registers.Timing;
            byte options = (byte)((byte)gain | (byte)integration);

            // Write the timing information
            EnableSensor();
            WriteRegister(command, options);
            DisableSensor();

            // Update the object
            _gain      = gain;
            _intPeriod = integration;
        }
Ejemplo n.º 11
0
        public OutOfProcessExecutor(Info info, IntegrationOptions integrationOptions)
        {
            _info = info;
            _integrationOptions = integrationOptions;
            string currentDirectory = Path.GetDirectoryName(GetType().Assembly.Location);

            if (String.IsNullOrWhiteSpace(integrationOptions.CodeBehindFileGeneratorPath))
            {
                _fullPathToExe = Path.Combine(currentDirectory, ExeName);
            }
            else
            {
                _fullPathToExe = integrationOptions.CodeBehindFileGeneratorPath;
            }
        }
        public HRSEmployeeRepositoryTest()
        {
            var config = new ConfigurationBuilder()
                         .AddJsonFile("integration.json")
                         .Build();

            var options = new IntegrationOptions()
            {
                HRS = config["Integration:HRS"],
                CAS = config["Integration:CAS"],
            };

            _configuration    = new Mock <IConfiguration>();
            _distributedCache = new Mock <IDistributedCache>();
            _configuration.Setup(configuration => configuration["Cache:Enabled"]).Returns("False");
            _repository = new HRSEmployeeRepository(Options.Create <IntegrationOptions>(options), _configuration.Object, _distributedCache.Object);
        }
        private static IntegrationOptions GetOptions(DTE dte)
        {
            var options = cachedOptions;

            if (options != null)
            {
                return(options);
            }

            int maxStepInstancesSuggestions;

            options = new IntegrationOptions
            {
                EnableSyntaxColoring          = GetGeneralOption(dte, "EnableSyntaxColoring", OptionDefaultValues.EnableSyntaxColoringDefaultValue),
                EnableOutlining               = GetGeneralOption(dte, "EnableOutlining", OptionDefaultValues.EnableOutliningDefaultValue),
                EnableIntelliSense            = GetGeneralOption(dte, "EnableIntelliSense", OptionDefaultValues.EnableIntelliSenseDefaultValue),
                LimitStepInstancesSuggestions = int.TryParse(GetGeneralOption(dte, "MaxStepInstancesSuggestions", OptionDefaultValues.MaxStepInstancesSuggestionsDefaultValue), out maxStepInstancesSuggestions),
                MaxStepInstancesSuggestions   = maxStepInstancesSuggestions,
                EnableAnalysis          = GetGeneralOption(dte, "EnableAnalysis", OptionDefaultValues.EnableAnalysisDefaultValue),
                EnableTableAutoFormat   = GetGeneralOption(dte, "EnableTableAutoFormat", OptionDefaultValues.EnableTableAutoFormatDefaultValue),
                EnableStepMatchColoring = GetGeneralOption(dte, "EnableStepMatchColoring", OptionDefaultValues.EnableStepMatchColoringDefaultValue),
                EnableTracing           = GetGeneralOption(dte, "EnableTracing", OptionDefaultValues.EnableTracingDefaultValue),
                TracingCategories       = GetGeneralOption(dte, "TracingCategories", OptionDefaultValues.TracingCategoriesDefaultValue),
                DisableRegenerateFeatureFilePopupOnConfigChange = GetGeneralOption(dte, "DisableRegenerateFeatureFilePopupOnConfigChange", OptionDefaultValues.DisableRegenerateFeatureFilePopupOnConfigChangeDefaultValue),
                GenerationMode = GetGeneralOption(dte, "GenerationMode", OptionDefaultValues.GenerationModeDefaultValue),
                CodeBehindFileGeneratorPath         = GetGeneralOption(dte, "PathToCodeBehindGeneratorExe", OptionDefaultValues.CodeBehindFileGeneratorPath),
                CodeBehindFileGeneratorExchangePath = GetGeneralOption(dte, "CodeBehindFileGeneratorExchangePath", OptionDefaultValues.CodeBehindFileGeneratorExchangePath),
                OptOutDataCollection     = GetGeneralOption(dte, "OptOutDataCollection", OptionDefaultValues.DefaultOptOutDataCollection),
                NormalizeLineBreaks      = GetGeneralOption(dte, "NormalizeLineBreaks", OptionDefaultValues.NormalizeLineBreaksDefaultValue),
                LineBreaksBeforeScenario = GetGeneralOption(dte, "LineBreaksBeforeScenario", OptionDefaultValues.DefaultLineBreaksBeforeScenario),
                LineBreaksBeforeExamples = GetGeneralOption(dte, "LineBreaksBeforeExamples", OptionDefaultValues.DefaultLineBreaksBeforeExamples),
                UseTabsForIndent         = GetGeneralOption(dte, "UseTabsForIndent", OptionDefaultValues.UseTabsForIndentDefaultValue),
                FeatureIndent            = GetGeneralOption(dte, "FeatureIndent", OptionDefaultValues.DefaultFeatureIndent),
                ScenarioIndent           = GetGeneralOption(dte, "ScenarioIndent", OptionDefaultValues.DefaultScenarioIndent),
                StepIndent      = GetGeneralOption(dte, "StepIndent", OptionDefaultValues.DefaultStepIndent),
                TableIndent     = GetGeneralOption(dte, "TableIndent", OptionDefaultValues.DefaultTableIndent),
                MultilineIndent = GetGeneralOption(dte, "MultilineIndent", OptionDefaultValues.DefaultMultilineIndent),
                ExampleIndent   = GetGeneralOption(dte, "ExampleIndent", OptionDefaultValues.DefaultExampleIndent),
                LegacyEnableSpecFlowSingleFileGeneratorCustomTool = GetGeneralOption(dte, "LegacyEnableSpecFlowSingleFileGeneratorCustomTool", OptionDefaultValues.LegacyEnableSpecFlowSingleFileGeneratorCustomTool)
            };
            cachedOptions = options;
            return(options);
        }
Ejemplo n.º 14
0
 public TraceConfiguration(IntegrationOptions integrationOptions) : this(integrationOptions.EnableTracing, integrationOptions.TracingCategories)
 {
     
 }
Ejemplo n.º 15
0
 public OutOfProcessTestGenerator(Info info, ProjectSettings projectSettings, IntegrationOptions integrationOptions)
 {
     _projectSettings      = projectSettings;
     _integrationOptions   = integrationOptions;
     _outOfProcessExecutor = new OutOfProcessExecutor(info, integrationOptions);
 }
Ejemplo n.º 16
0
 public static void LogException <TIntegration, TTarget>(Exception exception)
 {
     DebugLog($"ProfilerOK: LogException<{typeof(TIntegration)}, {typeof(TTarget)}>({exception})");
     IntegrationOptions <TIntegration, TTarget> .LogException(exception);
 }
 public void ClearCache()
 {
     cachedOptions = null;
 }
Ejemplo n.º 18
0
 public LehmanSistersPaymentProvider(IHttpClientFactory httpClientFactory, IOptions <IntegrationOptions> configuration)
 {
     _options                = configuration.Value;
     _httpClient             = httpClientFactory.CreateClient(nameof(LehmanSistersPaymentProvider));
     _httpClient.BaseAddress = new Uri(_options.INTEGRATION_LEHMANSISTERS_BASEURL);
 }
Ejemplo n.º 19
0
 public bool HasChanged(IntegrationOptions integrationOptions)
 {
     return integrationOptions.EnableTracing != Enabled ||
            integrationOptions.TracingCategories != tracingCategoriesString;
 }
 public DebitSuissePaymentProvider(IHttpClientFactory httpClientFactory, IOptions <IntegrationOptions> configuration)
 {
     _options                = configuration.Value;
     _httpClient             = httpClientFactory.CreateClient(nameof(DebitSuissePaymentProvider));
     _httpClient.BaseAddress = new Uri(_options.INTEGRATION_DEBITSUISSE_BASEURL);
 }
 public OutOfProcessTestGeneratorFactory(IIdeTracer tracer, IntegrationOptions integrationOptions)
 {
     _tracer               = tracer;
     _integrationOptions   = integrationOptions;
     _outOfProcessExecutor = new OutOfProcessExecutor(_info, integrationOptions);
 }
Ejemplo n.º 22
0
 public static void LogException <TIntegration, TTarget>(Exception exception)
 {
     IntegrationOptions <TIntegration, TTarget> .LogException(exception);
 }
Ejemplo n.º 23
0
 public TraceConfiguration(IntegrationOptions integrationOptions) : this(integrationOptions.EnableTracing, integrationOptions.TracingCategories)
 {
 }
 public OutOfProcessTestGeneratorFactory(IntegrationOptions integrationOptions)
 {
     _integrationOptions   = integrationOptions;
     _outOfProcessExecutor = new OutOfProcessExecutor(_info, integrationOptions);
 }
Ejemplo n.º 25
0
 public bool HasChanged(IntegrationOptions integrationOptions)
 {
     return(integrationOptions.EnableTracing != Enabled ||
            integrationOptions.TracingCategories != tracingCategoriesString);
 }