/// <summary> /// Start this service. /// </summary> protected override void OnStart(string[] args) { Logger logger = LogManager.GetCurrentClassLogger(); // logger.Info(args.Length); // foreach (var str in args) { // logger.Info(str); // } string[] imagePathArgs = Environment.GetCommandLineArgs(); foreach (var str in imagePathArgs) { logger.Debug(str); } Directory.SetCurrentDirectory(imagePathArgs[1]); //th = new Thread(new ThreadStart(StartService)); //th.Start(); _service.LoadSettings(); string result = _service.StartService(); _service.StartSheduler(); logger.Info(result); }
static void Main(string[] args) { Logger logger = LogManager.GetCurrentClassLogger(); ServiceSA1C service = new ServiceSA1C(); service.LoadSettings(); var baseConfig = from conf in service.config.basesConfig where conf.Name == "ТестОбмена" select conf; if (baseConfig.Count() == 0) { } BaseConfig bc = baseConfig.First(); //var baseConfig = service.GetBaseConfig(); string pathToPravila = Directory.GetCurrentDirectory() + @"\ПравилаОбменаДанными.xml"; using (_1Cv8 v8 = new _1Cv8(bc.baseInfo)) { try { v8.Connect(); v8.SaveUniversalXML("ОбменУправлениеТорговлейРозничнаяТорговля", "002", pathToPravila); } catch (Exception error) { string e = error.Message; } } }
public MainWindowViewModel(ServiceSA1C serviceSA1C) { DisplayName = "SA1C"; _serviceSA1C = serviceSA1C; _serviceSA1C.LoadSettings(); _workspaces = null; }
public override void Refresh() { base.Refresh(); _serviceSA1C.LoadSettings(); this.CreateAllBaseConfig(); CurrentConfig = null; foreach (CommandViewModel command in Commands) { if (command.DisplayName == "Изменить настройку" || command.DisplayName == "Удалить настройку") { command.IsEnabled = false; } } }
private void EcecuteCmd() { if (CommandLineArgs.ContainsKey("/setting")) { string settingName = CommandLineArgs["/setting"] as string; logger.Info("Запуск с праметром /setting:" + settingName); //загружаем настройки ServiceSA1C serviceSA1C = new ServiceSA1C(); serviceSA1C.LoadSettings(); //и запускаем обмен serviceSA1C.ExecuteExchange(settingName); //выходим из программы App.Current.Shutdown(); } }