public FilePackageHelper(string string_1, int int_1, IActionType interface31_1, IStreamContractHelper interface9_1) { this.string_0 = string_1; this.int_0 = int_1; this.interface31_0 = interface31_1; this.interface9_0 = interface9_1; }
private void testToolStripMenuItem_Click(object sender, EventArgs e) { if (SelectedSection == null) { return; } ToolStripMenuItem menu = sender as ToolStripMenuItem; IActionType type = menu.Tag as IActionType; if (type != null) { ActionItem item = new ActionItem(type.DisplayName); item.Params = new SectionParamCollection(MpeInstaller.ActionProviders[type.DisplayName].GetDefaultParams()); ActionEdit dlg = new ActionEdit(Package, item); if (dlg.ShowDialog() == DialogResult.OK) { if (SelectedSection != null) { SelectedSection.Actions.Items.Add(item); list_actions.Items.Add(item); } } } }
public IEnumerable <ParameterValue> CreateParameterValues(IActionType actionProcessor) { if (actionProcessor.ParameterObject != null) { return(actionProcessor.ParameterObject.Select(x => new ParameterValue(x.Key, x.Value.GetType()))); } return(new List <ParameterValue>()); }
public Class75() { this.bool_0 = false; this.string_0 = ""; this.interface31_0 = null; this.interface9_0 = null; this.p2PSessionMessageTypeRoom_0 = null; }
private ActionView ViewModelFromDomainModel(IActionType domainAction, int uniqueId) { return(new ActionView { Id = uniqueId, Name = domainAction.Name, Params = domainAction.ParamSchemas .Select(ViewModelFromDomainModel) .ToList() }); }
public IAction CreateAction(IActionConfig config, IActionType type) { if (config == null || !config.Enabled) { return(null); } lock (mActions.SyncRoot) { CAction action = mActions[config.Name] as CAction; if (action == null) { if (type == null) { type = mSystemContext.ActionTypeManager.GetConfig(config.Type); } if (type != null && type.Enabled && !type.ActionClass.Equals("")) { if (!type.FileName.Equals("")) { action = CommonUtil.CreateInstance(SystemContext, type.FileName, type.ActionClass) as CAction; } else { action = CommonUtil.CreateInstance(type.ActionClass) as CAction; } } if (action != null) { if (action.Init(this, config, type)) { action.OnActionStateChanged += new ActionStateChanged(DoActionStateChanged); action.OnBeforeAction += new ActionEvent(DoBeforeAction); action.OnAfterAction += new ActionEvent(DoAfterAction); mActions.Add(action.Name, action); action.RefreshState(); } else { return(null); } } } else { action.Config = config; } return(action); } }
public Class75(IActionType interface31_1, IStreamContractHelper interface9_1, P2PSessionMessageTypeRoom p2PSessionMessageTypeRoom_1) { this.bool_0 = false; this.string_0 = ""; this.interface31_0 = null; this.interface9_0 = null; this.p2PSessionMessageTypeRoom_0 = null; this.interface31_0 = interface31_1; this.interface9_0 = interface9_1; this.p2PSessionMessageTypeRoom_0 = p2PSessionMessageTypeRoom_1; }
public IAction CreateAction(IActionConfig config) { if (config != null) { IActionType type = mSystemContext.ActionTypeManager.GetConfig(config.Type); return(CreateAction(config, type)); } else { return(null); } }
public void ShowAddDialog(IActionType type) { Text = "新增动作模块"; mIsOk = false; mManager = type.SystemContext.ActionConfigManager; mType = type; mConfig = null; InitTypeList(mManager.SystemContext); if (InitDialog()) { ShowDialog(); } }
public bool Init(IActionManager manager, IActionConfig config, IActionType type) { mConfig = config; mManager = manager; mType = type; if (!IsInit && Verify(ACOpts.Exec_Init)) { if (mManager.SystemContext.MonitorSystem.IsLocal) { if (InitAction()) { State = ActionState.Init; Config = mConfig; if (!IsActive && mConfig.AutoRun) { this.Start(); } return(true); } } else if (mManager.SystemContext.RemoteManageClient != null) { SystemContext.RemoteManageClient.OnConnected -= new ClientConnectEvent(DoConnected); SystemContext.RemoteManageClient.OnDisconnected -= new ClientConnectEvent(DoDisconnected); SystemContext.RemoteManageClient.OnReceiveData -= new ClientReceiveEvent(DoReceiveData); SystemContext.RemoteManageClient.OnConnected += new ClientConnectEvent(DoConnected); SystemContext.RemoteManageClient.OnDisconnected += new ClientConnectEvent(DoDisconnected); SystemContext.RemoteManageClient.OnReceiveData += new ClientReceiveEvent(DoReceiveData); IRemoteSystem rs = mManager.SystemContext.MonitorSystem as IRemoteSystem; if (rs != null) { StringBuilder sb = new StringBuilder(mManager.SystemContext.RequestHeadInfo); sb.Append(string.Format("{0}<Action>", Name)); sb.Append("Init<Command>"); sb.Append(string.Format("{0}<Type>", mType.ToXml())); sb.Append(string.Format("{0}<Config>", mConfig.ToXml())); return(mManager.SystemContext.RemoteManageClient.WaitReliableSend(rs.Config.IP, rs.Config.Port, sb.ToString())); } } } return(false); }
public void ShowAddDialog(IConfigManager <IActionType> manager) { Text = "新增动作类型"; mIsOk = false; mConfig = null; mManager = manager; if (mManager.SystemContext.MonitorSystem.Verify(manager.TypeName, "联动模块", (ushort)ACOpts.Manager_Add, false)) { if (InitDialog()) { ShowDialog(); } } }
public override void ShowEditDialog(IConfig config) { Text = "编辑动作类型 - [" + config.Name + "]"; mIsOk = false; mManager = null; mConfig = config as IActionType; if (config.Verify(ACOpts.Manager_Modify, false)) { if (InitDialog()) { ShowDialog(); } } }
public override void ShowEditDialog(IConfig config) { Text = "编辑动作模块 - [" + config.Name + "]"; mIsOk = false; mManager = null; mType = null; mConfig = config as IActionConfig; if (config.Verify(ACOpts.Manager_Modify, false)) { InitTypeList(config.SystemContext); if (InitDialog()) { ShowDialog(); } } }
public Node(Classification classification, IActionType preAction, IActionType action, IActionType postAction, ChoiceGroup children, Direction dir, AttackUI ui) { this.classification = classification; this.preAction = preAction; this.action = action; this.postAction = postAction; if (children != null) { this.children = children; } else { this.children = new ChoiceGroup(); } this.dir = dir; this.ui = ui; }
public static ScriptType Parse(string id, OrderedDictionary section, List <IActionType> types, Logger logger) { string name = id; List <ScriptAction> actions = new List <ScriptAction>(); try { foreach (DictionaryEntry entry in section) { if ((entry.Key as string) == "Name") { name = entry.Value as string; } else { string[] split = (entry.Value as string).Split(','); if (split.Length < 2) { logger.Add("ScriptType " + id + ": Entry not in format: <Index>=<Action>,<Parameter>"); } else { int a = int.Parse(split[0]); int p = int.Parse(split[1]); IActionType actionType = types.First(x => x.Code == (uint)a); ScriptAction action = new ScriptAction(actionType, p); actions.Add(action); } } } } catch (Exception) { string msg = "Error occured at ScriptType: [" + id + "]" + "\nPlease verify its format. Application will now close."; MessageBox.Show(msg, "Parse Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1); Application.Exit(); } return(new ScriptType(id, name, actions)); }
protected bool SetConfig() { if (mConfig == null && mManager != null) { mConfig = mManager.CreateConfigInstance(); } if (mConfig != null) { (mConfig as CConfig).Name = textBox_name.Text; mConfig.SetValue("Name", textBox_name.Text); mConfig.Desc = textBox_desc.Text; mConfig.ConfigClass = textBox_configClass.Text; mConfig.ConfigFormClass = textBox_formClass.Text; mConfig.ActionClass = textBox_createClass.Text; mConfig.FileName = textBox_fileName.Text; mConfig.Enabled = checkBox_enabled.Checked; return(true); } return(false); }
public static void AddActionProvider(IActionType ac) { ActionProviders.Add(ac.DisplayName, ac); }
private IEnumerable <ParameterValue> CreateParemeterValues(IActionType actionType) { return(_automationService.CreateParameterValues(actionType)); }
public bool InitMonitor(IMonitorConfig config) { IVisionMonitorConfig vmConfig = config as IVisionMonitorConfig; if (vmConfig != null) { IVideoSourceConfig vsConfig = config.SystemContext.GetVideoSourceConfig(vmConfig.Watcher.ActiveVisionParamConfig.VSName); if (vsConfig != null) { IVideoSourceType vsType = config.SystemContext.GetVideoSourceType(vsConfig.Type); StringBuilder sb = new StringBuilder(config.SystemContext.RequestHeadInfo); sb.Append(vsConfig.Name + "<VideoSource>"); sb.Append("Open;Play;InitKernel<Command>"); sb.Append(vsType.ToXml() + "<Type>"); sb.Append(vsConfig.ToXml() + "<Config><CommandSegment>"); IActionConfig ac; IActionParam[] apList; if (!config.Watcher.ActiveActionParamConfig.LocalAlarmAction) { apList = config.Watcher.ActiveActionParamConfig.GetAlarmActionList(); if (apList != null) { foreach (IActionParam pc in apList) { ac = config.SystemContext.ActionConfigManager.GetConfig(pc.Name); if (ac != null) { IActionType at = config.SystemContext.ActionTypeManager.GetConfig(ac.Type); if (at != null) { sb.Append(ac.Name + "<Action>"); sb.Append("Init;Start<Command>"); sb.Append(at.ToXml() + "<Type>"); sb.Append(ac.ToXml() + "<Config><CommandSegment>"); } } } } } if (!config.Watcher.ActiveActionParamConfig.LocalTransactAction) { apList = config.Watcher.ActiveActionParamConfig.GetTransactActionList(); if (apList != null) { foreach (IActionParam pc in apList) { ac = config.SystemContext.ActionConfigManager.GetConfig(pc.Name); if (ac != null) { IActionType at = config.SystemContext.ActionTypeManager.GetConfig(ac.Type); if (at != null) { sb.Append(ac.Name + "<Action>"); sb.Append("Init;Start<Command>"); sb.Append(at.ToXml() + "<Type>"); sb.Append(ac.ToXml() + "<Config><CommandSegment>"); } } } } } IMonitorType vuType = config.SystemContext.GetMonitorType(config.Type); sb.Append(config.Name + "<Monitor>"); sb.Append("Init<Command>"); sb.Append(vuType.ToXml() + "<Type>"); sb.Append(config.ToXml() + "<Config>"); IRemoteSystem rs = config.SystemContext.MonitorSystem as IRemoteSystem; if (rs != null) { return(WaitReliableSend(rs.Config.IP, rs.Config.Port, sb.ToString())); } else { return(WaitReliableSend(config.Host, config.Port, sb.ToString())); } } } else { IMonitorType vuType = config.SystemContext.GetMonitorType(config.Type); StringBuilder sb = new StringBuilder(config.SystemContext.RequestHeadInfo); sb.Append(config.Name + "<Monitor>"); sb.Append("Init<Command>"); sb.Append(vuType.ToXml() + "<Type>"); sb.Append(config.ToXml() + "<Config>"); IRemoteSystem rs = config.SystemContext.MonitorSystem as IRemoteSystem; if (rs != null) { return(WaitReliableSend(rs.Config.IP, rs.Config.Port, sb.ToString())); } else { return(WaitReliableSend(config.Host, config.Port, sb.ToString())); } } return(false); }
public ScriptAction(ScriptAction other) { this.action = other.action; this.param = other.param; this.offset = other.offset; }
public ScriptAction(IActionType action, int param) { this.action = action; GetOffset(param, out this.param, out offset); }
public CHKAlarmOutAction(IActionManager manager, IActionConfig config, IActionType type) : base(manager, config, type) { }
public CAction(IActionManager manager, IActionConfig config, IActionType type) { mSyncActionEvent = DoActionEvent; Init(manager, config, type); }
public void method_5(IActionType interface31_1) { this.interface31_0 = interface31_1; }
public CSoundAction(IActionManager manager, IActionConfig config, IActionType type) : base(manager, config, type) { }
public IEnumerable<ParameterValue> CreateParameterValues(IActionType actionProcessor) { if (actionProcessor.ParameterObject != null) return actionProcessor.ParameterObject.Select(x => new ParameterValue(x.Key, x.Value.GetType())); return new List<ParameterValue>(); }
public static void AddRemoteConfig(IMonitorSystemContext context, string name, string data, bool saveConfig) { IConfig config = null; if (data.StartsWith("<Monitor>")) { config = context.MonitorConfigManager.GetConfig(name); if (config == null) { IMonitorConfig monitorConfig = context.MonitorConfigManager.BuildConfigFromXml(data) as IMonitorConfig; if (monitorConfig != null) { context.MonitorConfigManager.Append(monitorConfig, saveConfig); } } } else if (data.StartsWith("<MonitorType>")) { config = context.MonitorTypeManager.GetConfig(name); if (config == null) { IMonitorType monitorType = context.MonitorTypeManager.BuildConfigFromXml(data) as IMonitorType; if (monitorType != null) { context.MonitorTypeManager.Append(monitorType, saveConfig); } } } else if (data.StartsWith("<VideoSource>")) { config = context.VideoSourceConfigManager.GetConfig(name); if (config == null) { IVideoSourceConfig vsConfig = context.VideoSourceConfigManager.BuildConfigFromXml(data) as IVideoSourceConfig; if (vsConfig != null) { context.VideoSourceConfigManager.Append(vsConfig, saveConfig); } } } else if (data.StartsWith("<VideoSourceType>")) { config = context.VideoSourceTypeManager.GetConfig(name); if (config == null) { IVideoSourceType vsType = context.VideoSourceTypeManager.BuildConfigFromXml(data) as IVideoSourceType; if (vsType != null) { context.VideoSourceTypeManager.Append(vsType, saveConfig); } } } else if (data.StartsWith("<Action>")) { config = context.ActionConfigManager.GetConfig(name); if (config == null) { IActionConfig actionConfig = context.ActionConfigManager.BuildConfigFromXml(data) as IActionConfig; if (actionConfig != null) { context.ActionConfigManager.Append(actionConfig, saveConfig); } } } else if (data.StartsWith("<ActionType>")) { config = context.ActionTypeManager.GetConfig(name); if (config == null) { IActionType actionType = context.ActionTypeManager.BuildConfigFromXml(data) as IActionType; if (actionType != null) { context.ActionTypeManager.Append(actionType, saveConfig); } } } else if (data.StartsWith("<Scheduler>")) { config = context.SchedulerConfigManager.GetConfig(name); if (config == null) { ISchedulerConfig schedulerConfig = context.SchedulerConfigManager.BuildConfigFromXml(data) as ISchedulerConfig; if (schedulerConfig != null) { context.SchedulerConfigManager.Append(schedulerConfig, saveConfig); } } } else if (data.StartsWith("<SchedulerType>")) { config = context.SchedulerTypeManager.GetConfig(name); if (config == null) { ISchedulerType schedulerType = context.SchedulerTypeManager.BuildConfigFromXml(data) as ISchedulerType; if (schedulerType != null) { context.SchedulerTypeManager.Append(schedulerType, saveConfig); } } } else if (data.StartsWith("<Task>")) { config = context.TaskConfigManager.GetConfig(name); if (config == null) { ITaskConfig taskConfig = context.TaskConfigManager.BuildConfigFromXml(data) as ITaskConfig; if (taskConfig != null) { context.TaskConfigManager.Append(taskConfig, saveConfig); } } } else if (data.StartsWith("<TaskType>")) { config = context.TaskTypeManager.GetConfig(name); if (config == null) { ITaskType taskType = context.TaskTypeManager.BuildConfigFromXml(data) as ITaskType; if (taskType != null) { context.TaskTypeManager.Append(taskType, saveConfig); } } } else if (data.StartsWith("<RemoteSystem>")) { config = context.RemoteSystemConfigManager.GetConfig(name); if (config == null) { IRemoteSystemConfig rsConfig = context.RemoteSystemConfigManager.BuildConfigFromXml(data) as IRemoteSystemConfig; if (rsConfig != null) { context.RemoteSystemConfigManager.Append(rsConfig, saveConfig); } } } else if (data.StartsWith("<Role>")) { config = context.RoleConfigManager.GetConfig(name); if (config == null) { IRoleConfig roleConfig = context.RoleConfigManager.BuildConfigFromXml(data) as IRoleConfig; if (roleConfig != null) { context.RoleConfigManager.Append(roleConfig, saveConfig); } } } else if (data.StartsWith("<User>")) { config = context.UserConfigManager.GetConfig(name); if (config == null) { IUserConfig userConfig = context.UserConfigManager.BuildConfigFromXml(data) as IUserConfig; if (userConfig != null) { context.UserConfigManager.Append(userConfig, saveConfig); } } } }
public CMonitorAction(IActionManager manager, IActionConfig config, IActionType type) : base(manager, config, type) { }
public I CreateConfigInstance(string type, string name) { if (!type.Equals("")) { if (TypeName.Equals("Actions")) { IActionType actionType = SystemContext.ActionTypeManager.GetConfig(type); if (actionType != null) { return(CreateConfigInstance(actionType, name)); } } else if (TypeName.Equals("Schedulers")) { ISchedulerType schedulerType = SystemContext.SchedulerTypeManager.GetConfig(type); if (schedulerType != null) { return(CreateConfigInstance(schedulerType, name)); } } else if (TypeName.Equals("Tasks")) { ITaskType taskType = SystemContext.TaskTypeManager.GetConfig(type); if (taskType != null) { return(CreateConfigInstance(taskType, name)); } } else if (TypeName.Equals("Monitors")) { IMonitorType monitorType = SystemContext.MonitorTypeManager.GetConfig(type); if (monitorType != null) { return(CreateConfigInstance(monitorType, name)); } } else if (TypeName.Equals("VideoSources")) { IVideoSourceType vsType = SystemContext.VideoSourceTypeManager.GetConfig(type); if (vsType != null) { return(CreateConfigInstance(vsType, name)); } } } IConfig config = CreateConfigInstance(); if (config != null) { if (name != null) { ((CConfig)config).Name = name; } ITypeConfig tc = config as ITypeConfig; if (tc != null) { tc.Type = type; } } return((I)config); }
public bool Init(ITaskManager manager, ITaskConfig config, ITaskType type) { mConfig = config; mManager = manager; mType = type; if (!IsInit && Verify(ACOpts.Exec_Init)) { if (mManager.SystemContext.MonitorSystem.IsLocal) { if (InitTask()) { State = TaskState.Init; Config = mConfig; if (!IsActive && mConfig.AutoRun) { this.Start(); } return(true); } } else if (mManager.SystemContext.RemoteManageClient != null) { SystemContext.RemoteManageClient.OnConnected -= new ClientConnectEvent(DoConnected); SystemContext.RemoteManageClient.OnDisconnected -= new ClientConnectEvent(DoDisconnected); SystemContext.RemoteManageClient.OnReceiveData -= new ClientReceiveEvent(DoReceiveData); SystemContext.RemoteManageClient.OnConnected += new ClientConnectEvent(DoConnected); SystemContext.RemoteManageClient.OnDisconnected += new ClientConnectEvent(DoDisconnected); SystemContext.RemoteManageClient.OnReceiveData += new ClientReceiveEvent(DoReceiveData); IRemoteSystem rs = mManager.SystemContext.MonitorSystem as IRemoteSystem; if (rs != null) { StringBuilder sb = new StringBuilder(mManager.SystemContext.RequestHeadInfo); ISchedulerConfig sc = mManager.SystemContext.SchedulerConfigManager.GetConfig(mConfig.Scheduler); if (sc != null) { ISchedulerType st = mManager.SystemContext.SchedulerTypeManager.GetConfig(sc.Type); if (st != null) { sb.Append(sc.Name + "<Scheduler>"); sb.Append("InitConfig<Command>"); sb.Append(st.ToXml() + "<Type>"); sb.Append(sc.ToXml() + "<Config><CommandSegment>"); } } IActionConfig ac; IActionParam[] apList = mConfig.GetActionList(); if (apList != null) { foreach (IActionParam pc in apList) { ac = mManager.SystemContext.ActionConfigManager.GetConfig(pc.Name); if (ac != null) { IActionType at = mManager.SystemContext.ActionTypeManager.GetConfig(ac.Type); if (at != null) { sb.Append(ac.Name + "<Action>"); sb.Append("Init;Start<Command>"); sb.Append(at.ToXml() + "<Type>"); sb.Append(ac.ToXml() + "<Config><CommandSegment>"); } } } } sb.Append(Name + "<Task>"); sb.Append("Init<Command>"); sb.Append(mType.ToXml() + "<Type>"); sb.Append(mConfig.ToXml() + "<Config>"); return(mManager.SystemContext.RemoteManageClient.WaitReliableSend(rs.Config.IP, rs.Config.Port, sb.ToString())); } } return(false); } else { return(true); } }
public void SetInterface31(IActionType interface31_1) { this.interface31_0 = interface31_1; }