public ServiceManager(ExecutionSupportCore core) { this.Core = core; this.Form = core.Form; this.Context = new HeroesSupportDataContext(); try { this.ServiceInfo = (from m in this.Context.MachineInfo where m.Address == "" select m).FirstOrDefault <MachineInfo>(); if (this.ServiceInfo == null) { this.ServiceInfo = new MachineInfo { Address = "", Status = "", Info = "" }; this.Context.MachineInfo.InsertOnSubmit(this.ServiceInfo); } } catch (Exception ex) { this.Core.LogManager.AddLog(LogType.ERROR, string.Format("Cannot initialize Service Context. : {0}", Settings.Default.ServiceName), new object[0]); this.Core.LogManager.AddLog(LogType.ERROR, ex.Message, new object[0]); } try { this.ServiceController = new ServiceController(Settings.Default.ServiceName); if (this.Status == ServiceStatus.None) { } } catch (Exception ex2) { this.Core.LogManager.AddLog(LogType.ERROR, string.Format("Can not initialize Service. : {0}", Settings.Default.ServiceName), new object[0]); this.Core.LogManager.AddLog(LogType.ERROR, ex2.Message, new object[0]); this.ServiceController = null; } }
public MachineManager(ExecutionSupportCore core) { this.Core = core; this.Form = core.Form; this.MachineDict = new Dictionary <string, Machine>(); this.Context = new HeroesSupportDataContext(); this.MF = new MessageHandlerFactory(); this.MF.Register <Machine>(Messages.TypeConverters, "ProcessMessage"); this.MF.Register <AdminClientNode>(AdminClientServiceOperationMessages.TypeConverters, "ProcessMessage"); this.RequestedCommand = MachineRequest.None; this.RequestedMachines = new HashSet <string>(); this.FileList = new FileList(Settings.Default.ServerBin, Settings.Default.DSBin); this.FileList.ExceptionOccurred += delegate(Exception ex) { this.Core.LogManager.AddLog(LogType.ERROR, "exception occurred in FileList : {0}", new object[] { ex }); }; this.LoadSettingFile(); this.RefreshMachineInfo(); }
public InputManager(ExecutionSupportCore core) { this.Core = core; this.Form = this.Core.Form; }
public LogManager(ExecutionSupportCore core) { this.Core = core; this.Form = core.Form; }