示例#1
0
        public static async Task <DeveloperMessage> GetNextDeveloperMessage()
        {
            try
            {
                var messages = await DeveloperMessageApi.GetDeveloperMessages();

                if (messages == null || messages.messages == null)
                {
                    return(null);
                }

                var readMessageIds = LocalConfiguration.DeveloperMessageShownIds;
                var unreadMessages = messages.messages.Where(x => !readMessageIds.Contains(x.id)).ToList();

                var firstUnreadMessage = unreadMessages.FirstOrDefault();

                if (firstUnreadMessage == null)
                {
                    return(null);
                }

                LocalConfiguration.AddIdToDeveloperMessageShownIds(firstUnreadMessage.id);
                return(firstUnreadMessage);
            }
            catch (Exception ex)
            {
                logger.Warn("GetNextDeveloperMessage failed: " + ex.ToString());
                AnalyticsHelper.Log("exception-GetNextDeveloperMessage", ex.Message, ex.ToString());
                return(null);
            }
        }
示例#2
0
        private void LoadFormConfiguration()
        {
            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location | ConfigFormOption.Size);

            string text; decimal tmpDecimal;

            text = LocalConfiguration.LoadControlCustomParameter(nUDNumberCount, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDNumberCount.Value = tmpDecimal;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDTimeForNumber, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out tmpDecimal))
            {
                nUDTimeForNumber.Value = tmpDecimal;
            }

            cBTimeForNumber.Checked = LocalConfiguration.LoadControlCustomParameter(cBTimeForNumber, "Checked") == "1";

            cBCounter.Checked        = LocalConfiguration.LoadControlCustomParameter(cBCounter, "Checked") == "1";
            cBRandomPosition.Checked = LocalConfiguration.LoadControlCustomParameter(cBRandomPosition, "Checked") == "1";
            cBWithNumber.Checked     = LocalConfiguration.LoadControlCustomParameter(cBWithNumber, "Checked") == "1";

            LocalConfiguration.LoadListCheckedItems(this, netCheckedListBox.ListBox);

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }
        private void LoadFormConfiguration()
        {
            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location);

            rbStraight.Checked = LocalConfiguration.LoadControlCustomParameter(rbStraight, "Checked") == "1";
            rbRandom.Checked   = LocalConfiguration.LoadControlCustomParameter(rbRandom, "Checked") == "1";

            if (!rbStraight.Checked && !rbRandom.Checked)
            {
                rbStraight.Checked = true;
            }

            string text = LocalConfiguration.LoadControlCustomParameter(cBList, "SelectedItem");

            if (!string.IsNullOrEmpty(text))
            {
                foreach (var item in cBList.Items)
                {
                    if (item.ToString() == text)
                    {
                        cBList.SelectedItem = item;
                        break;
                    }
                }
            }

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }
        void SaveFormConfiguration(object sender, FormClosedEventArgs e)
        {
            ProgramConfiguraton.SaveFormParams(this, ConfigFormOption.Location);
            LocalConfiguration.SaveControlCustomParameter(nUDVisibleTime, "Value", nUDVisibleTime.Value.ToString());

            LocalConfiguration.SaveControlCustomParameter(cBVisionTime, "Checked", cBVisionTime.Checked ? "1" : "0");

            LocalConfiguration.SaveControlCustomParameter(rbAddition, "Checked", rbAddition.Checked ? "1" : "0");
            LocalConfiguration.SaveControlCustomParameter(rbMultiplication, "Checked", rbMultiplication.Checked ? "1" : "0");
            LocalConfiguration.SaveControlCustomParameter(cBTimeForAnswer, "Checked", cBTimeForAnswer.Checked ? "1" : "0");
            LocalConfiguration.SaveControlCustomParameter(cBAddMinus, "Checked", cBAddMinus.Checked ? "1" : "0");

            LocalConfiguration.SaveControlCustomParameter(nUDNumberCount, "Value", nUDNumberCount.Value.ToString());

            LocalConfiguration.SaveControlCustomParameter(nUDTimeForAnswer, "Value", nUDTimeForAnswer.Value.ToString());

            LocalConfiguration.SaveControlCustomParameter(nUDx1Left, "Value", nUDx1Left.Value.ToString());
            LocalConfiguration.SaveControlCustomParameter(nUDx1Right, "Value", nUDx1Right.Value.ToString());
            LocalConfiguration.SaveControlCustomParameter(nUDx2Left, "Value", nUDx2Left.Value.ToString());
            LocalConfiguration.SaveControlCustomParameter(nUDx2Right, "Value", nUDx2Right.Value.ToString());

            train.SaveExeruciseSerie();

            ProgramConfiguraton.SaveXmlConfig();
        }
示例#5
0
        /// <summary>
        /// Gets, sets, or restores a value of a legacy configuration option.
        /// </summary>
        private static object GetSetRestore(LocalConfiguration config, string option, object value, IniAction action)
        {
            MsSqlLocalConfig  local    = (MsSqlLocalConfig)config.GetLibraryConfig(MsSqlLibraryDescriptor.Singleton);
            MsSqlLocalConfig  @default = DefaultLocal;
            MsSqlGlobalConfig global   = Global;

            switch (option)
            {
            // local:

            case "mssql.connect_timeout":
                return(PhpIni.GSR(ref local.ConnectTimeout, @default.ConnectTimeout, value, action));

            case "mssql.timeout":
                return(PhpIni.GSR(ref local.Timeout, @default.Timeout, value, action));

            case "mssql.batchsize":
                return(PhpIni.GSR(ref local.BatchSize, @default.BatchSize, value, action));

            // global:

            case "mssql.max_links":
                Debug.Assert(action == IniAction.Get);
                return(PhpIni.GSR(ref global.MaxConnections, 0, null, action));

            case "mssql.secure_connection":
                Debug.Assert(action == IniAction.Get);
                return(PhpIni.GSR(ref global.NTAuthentication, false, null, action));
            }

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }
        private async Task WriteFilter(Filter baseFilter, bool isGeneratingStylesAndSeed, string outputFolder = null)
        {
            if (File.Exists(outputFolder + "RESULTS.zip"))
            {
                File.Delete(outputFolder + "RESULTS.zip");
            }

            var oldSeedVersion = baseFilter.GetHeaderMetaData("version:");
            var newVersion     = LocalConfiguration.GetInstance().YieldConfiguration().First(x => x.Key == "Version Number").Value;

            if (oldSeedVersion == newVersion)
            {
                var isStopping = !InfoPopUpMessageDisplay.DisplayQuestionMessageBox("Error: \n\nVersion did not change!\nDo you want to continue the filter generation?");
                if (isStopping)
                {
                    return;
                }
            }
            else
            {
                baseFilter.SetHeaderMetaData("version:", newVersion);
            }

            await FilterWriter.WriteFilter(baseFilter, isGeneratingStylesAndSeed, outputFolder, Configuration.AppSettings["StyleSheet Folder"]);
        }
示例#7
0
        /// <summary>
        /// Gets, sets, or restores a value of a legacy configuration option.
        /// </summary>
        private static object GetSetRestore(LocalConfiguration config, string option, object value, IniAction action)
        {
            IconvLocalConfig  local    = (IconvLocalConfig)config.GetLibraryConfig(IconvLibraryDescriptor.Singleton);
            IconvLocalConfig  @default = DefaultLocal;
            IconvGlobalConfig global   = Global;

            //[iconv]
            //;iconv.input_encoding = ISO-8859-1
            //;iconv.internal_encoding = ISO-8859-1
            //;iconv.output_encoding = ISO-8859-1

            switch (option)
            {
            //// local:

            case "iconv.input_encoding":
                return(PhpIni.GSR(ref local.InputEncoding, @default.InputEncoding, value, action));

            case "iconv.internal_encoding":
                return(PhpIni.GSR(ref local.InternalEncoding, @default.InternalEncoding, value, action));

            case "iconv.output_encoding":
                return(PhpIni.GSR(ref local.OutputEncoding, @default.OutputEncoding, value, action));
            }

            Debug.Fail("Option '" + option + "' is supported but not implemented.");
            return(null);
        }
示例#8
0
        private void LoadFormConfiguration()
        {
            int temp;

            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location | ConfigFormOption.Size);

            string text;

            text = LocalConfiguration.LoadControlCustomParameter(nUDVisibleTime, "Value");
            if (!string.IsNullOrEmpty(text) && int.TryParse(text, out temp))
            {
                nUDVisibleTime.Value = temp;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDTimeNextCircle, "Value");
            if (!string.IsNullOrEmpty(text) && int.TryParse(text, out temp))
            {
                nUDTimeNextCircle.Value = temp;
            }

            chBVisionTime.Checked = LocalConfiguration.LoadControlCustomParameter(chBVisionTime, "Checked") == "1";
            chBNextCircle.Checked = LocalConfiguration.LoadControlCustomParameter(chBNextCircle, "Checked") == "1";

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }
 public GitService(ILogger logger, SourceConnectionConfiguration sourceConnectionConfiguration,
                   TargetConnectionConfiguration targetConnectionConfiguration, LocalConfiguration localConfiguration, IDirectoryService directoryService)
 {
     _logger = logger;
     _sourceConnectionConfiguration = sourceConnectionConfiguration;
     _targetConnectionConfiguration = targetConnectionConfiguration;
     _localConfiguration            = localConfiguration;
     _directoryService = directoryService;
 }
        private void InitializeLocalConfiguration()
        {
            this.Configuration = LocalConfiguration.GetInstance();
            var data = this.Configuration.YieldConfiguration().ToList();

            data.ForEach(x => ConfigurationData.Add(x));

            this.ConfigGrid.ItemsSource = ConfigurationData;
        }
示例#11
0
 private ConfigurationService()
 {
     configurationFile = new ConfigurationBuilder()
                         .AddJsonFile(configFileName, false)
                         .Build();
     Configuration = new LocalConfiguration();
     configurationFile.Bind(Configuration);
     Configuration.PropertyChanged += Configuration_PropertyChanged;
 }
        public void SaveFormConfiguration()
        {
            ProgramConfiguraton.SaveFormParams(this, ConfigFormOption.Location | ConfigFormOption.Maximized | ConfigFormOption.Size);

            LocalConfiguration.SaveControllerConfiguration(this, saController);

            LocalConfiguration.SaveFormCustomParameter(this, "LinesCount", tSCBLinesCount.SelectedItem.ToString());

            ProgramConfiguraton.SaveXmlConfig();
        }
示例#13
0
        private static bool VerifyFilter(Filter baseFilter)
        {
            var errorMsg = new List <string>();

            var oldSeedVersion = baseFilter.GetHeaderMetaData("version:");
            var newVersion     = LocalConfiguration.GetInstance().YieldConfiguration().First(x => x.Key == "Version Number").Value;

            if (oldSeedVersion == newVersion)
            {
                errorMsg.Add("Version did not change!");
            }
            else
            {
                baseFilter.SetHeaderMetaData("version:", newVersion);
            }

            // add missing UP command tags // currently unused/unnecessary plus bug: trinkets/amulets/... should not be affected by this!!
//            foreach (var entry in baseFilter.FilterEntries)
//            {
//                if (entry.Header.Type != FilterConstants.FilterEntryType.Content) continue;
//
//                if (!(entry?.Content?.Content?.ContainsKey("ItemLevel") ?? false)) continue;
//                if (entry.Content.Content["ItemLevel"]?.Count != 1) continue;
//                var ilvl = entry.Content.Content["ItemLevel"].Single().Value as NumericValueContainer;
//                if (ilvl == null) continue;
//                if (ilvl.Value != "65" || ilvl.Operator != ">=") continue;
//
//                if (!(entry?.Content?.Content?.ContainsKey("SetTextColor") ?? false)) continue;
//
//                if (entry.Header.HeaderValue == "Hide") continue;
//
//                if (!entry.Content.Content.ContainsKey("Rarity")) continue;
//                var rarity = entry.Content.Content["Rarity"].Single().Value as NumericValueContainer;
//                if (rarity.Value != "Rare") continue;
//                if (!string.IsNullOrEmpty(rarity.Operator))
//                {
//                    if (rarity.Operator.Contains("<") || rarity.Operator.Contains(">")) continue;
//                }
//
//                if (entry.Header.GenerationTags.Any(tag => tag is RaresUpEntryCommand)) continue;
//
//                InfoPopUpMessageDisplay.ShowInfoMessageBox("Adding UP tag to this entry:\n\n\n" + string.Join("\n", entry.Serialize()));
//                entry.Header.GenerationTags.Add(new RaresUpEntryCommand(entry as FilterEntry) { Value = "UP", Strictness = -1});
//            }

//            FilterStyleVerifyer.Run(baseFilter); // todo: re-enable this when the filter doesnt have the tons of errors anymore

            if (errorMsg.Count > 0)
            {
                var isStopping = !InfoPopUpMessageDisplay.DisplayQuestionMessageBox("Error: \n\n" + string.Join("\n", errorMsg) + "\n\nDo you want to continue the filter generation?");
                return(isStopping);
            }

            return(false);
        }
 public VehicleController(
     ILogger <VehicleController> logger,
     IMessagePublisher publisher,
     LocalConfiguration localConfiguration,
     IOperationalUnit operationalUnit)
 {
     _logger             = logger;
     _operationalUnit    = operationalUnit;
     _publisher          = publisher;
     _localConfiguration = localConfiguration;
 }
示例#15
0
        void SaveFormConfiguration(object sender, FormClosedEventArgs e)
        {
            ProgramConfiguraton.SaveFormParams(this, ConfigFormOption.Location);
            LocalConfiguration.SaveControlCustomParameter(nUDVisibleTime, "Value", nUDVisibleTime.Value.ToString());

            LocalConfiguration.SaveControlCustomParameter(rbNormal, "Checked", rbNormal.Checked ? "1" : "0");
            LocalConfiguration.SaveControlCustomParameter(rbInverse, "Checked", rbInverse.Checked ? "1" : "0");
            LocalConfiguration.SaveControlCustomParameter(rBRandom, "Checked", rBRandom.Checked ? "1" : "0");

            ProgramConfiguraton.SaveXmlConfig();
        }
        void SaveFormConfiguration(object sender, FormClosedEventArgs e)
        {
            ProgramConfiguraton.SaveFormParams(this, ConfigFormOption.Location);

            LocalConfiguration.SaveControlCustomParameter(nUDVisibleTime, "Value", nUDVisibleTime.Value.ToString());
            LocalConfiguration.SaveControlCustomParameter(cBAutoShow, "Checked", cBAutoShow.Checked ? "1" : "0");

            train.SaveExeruciseSerie();

            ProgramConfiguraton.SaveXmlConfig();
        }
        protected Dictionary <string, object> GetBaseConfigurations <TSource>(MemberExpression memberExpression)
        {
            var config         = LocalConfiguration.Get().GetSection("TableStorage");
            var configurations = new Dictionary <string, object>();

            configurations.Add <TSource>(TableStorageConstants.ConnectionString, config["ConnectionString"]);
            configurations.Add <TSource>(TableStorageConstants.PartitionMemberExpression, memberExpression);


            return(configurations);
        }
示例#18
0
        private void LoadFormConfiguration()
        {
            decimal temp; string text;

            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location);

            text = LocalConfiguration.LoadControlCustomParameter(nUDSymbolsCount, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out temp))
            {
                nUDSymbolsCount.Value = temp;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDWordsCount, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out temp))
            {
                nUDWordsCount.Value = temp;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDVisibleTime, "Value");
            if (!string.IsNullOrEmpty(text) && decimal.TryParse(text, out temp))
            {
                nUDVisibleTime.Value = temp;
            }

            text = LocalConfiguration.LoadControlCustomParameter(rbSymbols, "Checked");
            rbSymbols.Checked = text == "1";

            text = LocalConfiguration.LoadControlCustomParameter(rbDictionary, "Checked");
            rbDictionary.Checked = text == "1";

            cbRandomSymbols.Checked = LocalConfiguration.LoadControlCustomParameter(cbRandomSymbols, "Checked") == "1";

            cBColor.Checked = LocalConfiguration.LoadControlCustomParameter(cBColor, "Checked") == "1";

            if (!rbDictionary.Checked && !rbSymbols.Checked)
            {
                rbSymbols.Checked = true;
            }

            text = LocalConfiguration.LoadControlCustomParameter(cBDictionary, "SelectedItem");
            if (!string.IsNullOrEmpty(text))
            {
                foreach (var item in cBDictionary.Items)
                {
                    if (item.ToString() == text)
                    {
                        cBDictionary.SelectedItem = item;
                        break;
                    }
                }
            }

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }
示例#19
0
        protected SearchRepositoryQueryTestsBase()
        {
            var searchConfig = LocalConfiguration.Get().GetSection("Search");
            var logger       = Substitute.For <ILogger>();

            SearchRepository = new SearchRepository(logger);

            SeedSearchBooks(searchConfig);

            SeedBookReviewers(searchConfig);
        }
示例#20
0
        private void ApplyAllSuggestions(object sender, RoutedEventArgs e)
        {
            this.TierListFacade.ApplyAllSuggestions();
            this.TierListFacade.TierListData.Values.ToList().ForEach(x => x.ReEvaluate());

            var json          = JsonConvert.SerializeObject(this.TierListFacade.Changelog).Replace("->", "_");
            var changeLogPath = LocalConfiguration.GetInstance().AppSettings["Output Folder"] + "/Changelog/changelog.json";

            FileWork.WriteTextAsync(changeLogPath, json);

            this.EventGrid.Publish();
        }
示例#21
0
        void SaveFormConfiguration(object sender, FormClosedEventArgs e)
        {
            ProgramConfiguraton.SaveFormParams(this, ConfigFormOption.Location | ConfigFormOption.Size);

            LocalConfiguration.SaveControlCustomParameter(nUDVisibleTime, "Value", nUDVisibleTime.Value.ToString());
            LocalConfiguration.SaveControlCustomParameter(nUDTimeNextCircle, "Value", nUDTimeNextCircle.Value.ToString());

            LocalConfiguration.SaveControlCustomParameter(chBVisionTime, "Checked", chBVisionTime.Checked ? "1" : "0");
            LocalConfiguration.SaveControlCustomParameter(chBNextCircle, "Checked", chBNextCircle.Checked ? "1" : "0");

            ProgramConfiguraton.SaveXmlConfig();
        }
示例#22
0
        private void OperateLocalSettingsPath(string pathName)
        {
            if (Directory.Exists(pathName))
            {
                Config.LocalSettingFolder = pathName;
            }

            LocalConfiguration.LoadXmlConfig();
            txtBDictionaryName.Text = Config.LocalSettingFolder;

            UpdateLabelsText();
        }
示例#23
0
        public void Startup(AppDomain appDomain)
        {
            Log.Info(typeof(ExceptionlessClient), "Client startup.");

            try {
                appDomain.UnhandledException -= OnAppDomainUnhandledException;
                appDomain.UnhandledException += OnAppDomainUnhandledException;
#if !PFX_LEGACY_3_5
                TaskScheduler.UnobservedTaskException -= TaskSchedulerOnUnobservedTaskException;
                TaskScheduler.UnobservedTaskException += TaskSchedulerOnUnobservedTaskException;
#endif
            } catch (Exception ex) {
                Log.Error(typeof(ExceptionlessClient), ex, "An error occurred while wiring up to the unhandled exception events. This will happen when you are not running under full trust.");
            }

            if (!Configuration.HasValidApiKey)
            {
                Log.Error(typeof(ExceptionlessClient), "Invalid Exceptionless API key. Please ensure that your API key is configured properly.");
            }

            Log.Info(typeof(ExceptionlessClient), "Triggering configuration update and queue processing...");

            UpdateConfigurationAsync();
            ProcessQueueAsync(1000);

            Log.Info(typeof(ExceptionlessClient), "Done triggering configuration update and queue processing.");

#if !SILVERLIGHT
            if (Configuration.TraceLogLimit > 0)
            {
                if (_traceListener != null && Trace.Listeners.Contains(_traceListener))
                {
                    Trace.Listeners.Remove(_traceListener);
                }

                _traceListener = new ExceptionlessTraceListener(Configuration.TraceLogLimit);
                Trace.Listeners.Add(_traceListener);
            }
#endif

            if (!_startupCalled)
            {
                LocalConfiguration.StartCount++;
                // TODO: This can be removed once we fix the bug in the ObservableConcurrentDictionary where IsDirty is not set immediately.
                LocalConfiguration.IsDirty = true;
                LocalConfiguration.Save();
            }

            _startupCalled = true;

            Log.Info(typeof(ExceptionlessClient), "Startup done.");
        }
示例#24
0
        private void LoadFormConfiguration()
        {
            decimal tempDecimal;
            int     tempInt;
            string  tempString;

            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location);

            LocalConfiguration.LoadListCheckedItems(this, netCheckedListBox.ListBox);

            tempString = LocalConfiguration.LoadControlCustomParameter(cBTestType, "SelectedIndex");
            if (!string.IsNullOrEmpty(tempString) && int.TryParse(tempString, out tempInt))
            {
                if (tempInt >= 0 && tempInt < cBTestType.Items.Count)
                {
                    cBTestType.SelectedIndex = tempInt;
                }
            }

            tempString = LocalConfiguration.LoadControlCustomParameter(nUDRight, "Value");
            if (!string.IsNullOrEmpty(tempString) && decimal.TryParse(tempString, out tempDecimal))
            {
                nUDRight.Value = tempDecimal;
            }

            tempString = LocalConfiguration.LoadControlCustomParameter(nUDLeft, "Value");
            if (!string.IsNullOrEmpty(tempString) && decimal.TryParse(tempString, out tempDecimal))
            {
                nUDLeft.Value = tempDecimal;
            }

            chbValueRange.Checked = LocalConfiguration.LoadControlCustomParameter(chbValueRange, "Checked") == "1";

            rBNumber.Checked      = LocalConfiguration.LoadControlCustomParameter(rBNumber, "Checked") == "0";
            rBCalculation.Checked = LocalConfiguration.LoadControlCustomParameter(rBCalculation, "Checked") == "1";

            if (!rBNumber.Checked && !rBCalculation.Checked)
            {
                rBNumber.Checked = true;
            }

            chBVisionTime.Checked = LocalConfiguration.LoadControlCustomParameter(chBVisionTime, "Checked") == "1";

            tempString = LocalConfiguration.LoadControlCustomParameter(nUDVisibleTime, "Value");
            if (!string.IsNullOrEmpty(tempString) && decimal.TryParse(tempString, out tempDecimal))
            {
                nUDVisibleTime.Value = tempDecimal;
            }

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }
示例#25
0
        public static bool Log(string message, LogAction action, string destination, string extraHeaders)
        {
            switch (action)
            {
            case LogAction.Default:

                bool result = true;

                LocalConfiguration config = Configuration.Local;

                // adds a message to the default log file:
                if (config.ErrorControl.LogFile != null)
                {
                    try { Logger.AppendLine(config.ErrorControl.LogFile, message); }
                    catch (System.Exception) { result = false; }
                }

                // adds a message to an event log:
                if (config.ErrorControl.SysLog)
                {
                    try { Logger.AddToEventLog(message); }
                    catch (System.Exception) { result = false; }
                }

                return(result);

            case LogAction.SendByEmail:
                Mailer.Mail(destination, LibResources.GetString("error_report"), message, extraHeaders);
                return(true);

            case LogAction.ToDebuggingConnection:
                PhpException.ArgumentValueNotSupported("action", (int)action);
                return(false);

            case LogAction.AppendToFile:
                try
                {
                    PHP.Core.Logger.AppendLine(destination, message);
                }
                catch (System.Exception)
                {
                    return(false);
                }
                return(true);

            default:
                PhpException.InvalidArgument("action");
                return(false);
            }
        }
 public MigrateVersionControlHostedService(ILogger logger, IGitService gitService, ITfsService tfsService, IDirectoryService directoryService,
                                           IApplicationLifetime appLifetime, ICommandlineArgsHelper commandlineArgsHelper, SourceConnectionConfiguration sourceConnectionConfiguration,
                                           TargetConnectionConfiguration targetConnectionConfiguration, LocalConfiguration localConfiguration)
 {
     _logger                        = logger;
     _gitService                    = gitService;
     _tfsService                    = tfsService;
     _directoryService              = directoryService;
     _appLifetime                   = appLifetime;
     _commandlineArgsHelper         = commandlineArgsHelper;
     _sourceConnectionConfiguration = sourceConnectionConfiguration;
     _targetConnectionConfiguration = targetConnectionConfiguration;
     _localConfiguration            = localConfiguration;
 }
        protected Dictionary <string, object> GetBaseConfigurations <TSource>(MemberExpression memberExpression)
        {
            var config = LocalConfiguration.Get().GetSection("TableStorage");

            "TableStorage loaded.".Log();
            $"Development = {config["ConnectionString"] == "UseDevelopmentStorage=true" }".Log();

            var configurations = new Dictionary <string, object>();

            configurations.Add <TSource>(TableStorageConstants.ConnectionString, config["ConnectionString"]);
            configurations.Add <TSource>(TableStorageConstants.PartitionMemberExpression, memberExpression);

            return(configurations);
        }
        private void LoadFormConfiguration()
        {
            int temp;

            ActivateControls();

            ProgramConfiguraton.LoadFormParams(this, ConfigFormOption.Location);

            string text = LocalConfiguration.LoadControlCustomParameter(nUDSeriesCount, "Value");

            if (!string.IsNullOrEmpty(text) && int.TryParse(text, out temp))
            {
                nUDSeriesCount.Value = temp;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDVisibleTime, "Value");
            if (!string.IsNullOrEmpty(text) && int.TryParse(text, out temp))
            {
                nUDVisibleTime.Value = temp;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDAdditionOption, "Value");
            if (!string.IsNullOrEmpty(text) && int.TryParse(text, out temp))
            {
                nUDAdditionOption.Value = temp;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDLeft, "Value");
            if (!string.IsNullOrEmpty(text) && int.TryParse(text, out temp))
            {
                nUDLeft.Value = temp;
            }

            text = LocalConfiguration.LoadControlCustomParameter(nUDRight, "Value");
            if (!string.IsNullOrEmpty(text) && int.TryParse(text, out temp))
            {
                nUDRight.Value = temp;
            }

            chBVisionTime.Checked     = LocalConfiguration.LoadControlCustomParameter(chBVisionTime, "Checked") == "1";
            chBAddition.Checked       = LocalConfiguration.LoadControlCustomParameter(chBAddition, "Checked") == "1";
            chBMultiplication.Checked = LocalConfiguration.LoadControlCustomParameter(chBMultiplication, "Checked") == "1";

            if (!chBAddition.Checked && !chBMultiplication.Checked)
            {
                chBAddition.Checked = true;
            }

            this.FormClosed += new FormClosedEventHandler(SaveFormConfiguration);
        }
示例#29
0
        public ServiceMenuModule()
        {
            Configuration = new LocalConfiguration <ServiceMenuActionSettings>(GetType().Name);
            var config = Configuration.GetConfiguration();

            if (config != null)
            {
                Settings.ActionCommandAttribute = config.ActionCommandAttribute;
                Settings.ViewOrder = config.ViewOrder;
            }
            else
            {
                DefaultSettings();
            }
        }
示例#30
0
        public void Configuration(IAppBuilder app, Func <IContainer> containerBuilder)
        {
#if DEBUG
            LocalConfiguration.SetEnvironmentVariables();
#endif

            var container = (containerBuilder ?? DefaultContainerBuilder)();
            var config    = new HttpConfiguration();
            EnableCors(config);
            config.MapHttpAttributeRoutes();
            config.DependencyResolver = new AutofacWebApiDependencyResolver(container);

            app.UseAutofacMiddleware(container);
            app.UseWebApi(config);
        }
		// Get configuration object
		public object GetConfiguration()
		{
			LocalConfiguration config = new LocalConfiguration();

			config.source = filters[deviceCombo.SelectedIndex].MonikerString;

			return (object) config;
		}