public ProcedureStepAppService( IRepository <ProcedureStep, Guid> repositoryProcedureStep, ProcedureManager procedureManager, TaskItemManager taskItemManager) : base(repositoryProcedureStep) { _procedureManager = procedureManager; _taskItemManager = taskItemManager; }
public static void GetProcedure() { //ProcedureRepository procedureRepository = new ProcedureRepository(); //List<ProcedureEntity> list = procedureRepository.LoadList(null); ProcedureManager procedureManager = new ProcedureManager(); Procedure procedure = procedureManager.GetProcedureData(); }
public override object CommandBody(params object[] paras) { if (paras.Length < 1) { throw new ArgumentException(); } List <ProcedureEntity> SaveData = paras[0] as List <ProcedureEntity>; ProcedureManager manager = new ProcedureManager(); if (OnProgress != null) { string TaskName = ProjectAllocationResource.Message.Procedure_TaskMessage_Validate; ProjectAllocationFramework.Statues.ProgressChangedEventArgs args = new ProjectAllocationFramework.Statues.ProgressChangedEventArgs(TaskName); OnProgress(null, args); } //check manager.DataValidation(OnProgress, SaveData); if (OnProgress != null) { string TaskName = ProjectAllocationResource.Message.Procedure_TaskMessage_Save; ProjectAllocationFramework.Statues.ProgressChangedEventArgs args = new ProjectAllocationFramework.Statues.ProgressChangedEventArgs(TaskName); OnProgress(null, args); } //save manager.SaveDataToDB(OnProgress, SaveData); return(SaveData); }
public void ExitCodeTest() { var cpm = new ProcedureManager(); using var command = cpm.OpenCommand("cmd.exe", "/c", "ping 127.0.0.1"); var result = command.Execute(); if (result.ExitCode != 0) { Debug.WriteLine(result.Output); Debug.WriteLine(result.ExitCode); Debug.WriteLine(command.Exception); } Assert.IsTrue(result.ExitCode == 0); using var command127 = cpm.OpenCommand("cmd.exe", "/c", "f**k.exe"); var result127 = command127.Execute(); if (result127.ExitCode != 0) { Debug.WriteLine(result127.Output); Debug.WriteLine(result127.ExitCode); Debug.WriteLine(command127.Exception); } Assert.IsTrue(result127.ExitCode == 1); }
public ProcedureCU(DBConnection conn) { InitializeComponent(); connection = conn; listQueries = new ListConnection(conn); tManager = new ProcedureManager(); }
public override object CommandBody(params object[] paras) { if (paras.Length < 2) { throw new ArgumentException(); } ProcedureSearchCondtion searchCondition = new ProcedureSearchCondtion(); searchCondition.ProcedureCode = paras[0] as string; searchCondition.ProcedureName = paras[1] as string; if (OnProgress != null) { string TaskName = ProjectAllocationResource.Message.Procedure_TaskMessage_Load; ProjectAllocationFramework.Statues.ProgressChangedEventArgs args = new ProjectAllocationFramework.Statues.ProgressChangedEventArgs(TaskName); OnProgress(null, args); } ProcedureManager manager = new ProcedureManager(); List <ProcedureEntity> data = manager.GetDataFromDB(OnProgress, searchCondition); Core.CoreData[CoreDataType.PROCEDURE_SEARCH] = data; return(data); }
public void CommandExceptionTest() { using var cpm = new ProcedureManager(); using var cp = cpm.OpenCommand("asdasdsa"); cp.Execute(); Assert.IsTrue(cp.Status == CommandStatus.Failed); Assert.IsTrue(cp.Exception.GetType() == typeof(Win32Exception)); }
private void Start() { ProcedureMgr = new ProcedureManager(); ProcedureMgr.OnInit(this); onGameReset(); }
void StartGame() { ProcedureManager.ChangeProcedure <Procedure_Launch>(); //SceneManager.LoadScene("Init"); RegisterGlobalMessage(); }
public override void Update(GameTime gameTime) { Move(); if (ProcedureManager != null) { ProcedureManager.PerformBehavior(this, gameTime, "Spawn"); } }
public void CommandExceptionTest() { using var cpm = new ProcedureManager(); using var cp = cpm.OpenCommand("asdasdsa"); (cp as CommandProcedure).DirectExecute = true; cp.Execute(); Assert.IsTrue(cp.Status == CommandStatus.InnerException); Assert.IsTrue(cp.Exception.GetType() == typeof(Win32Exception)); }
protected override void OnUpdate() { base.OnUpdate(); if (progress >= 100) { ProcedureManager.ChangeProcedure <Procedure_Login>(); } progress += 3; sliderProgress.value = progress / 100f; }
public StatementDataRefAppService( TaskItemManager taskItemManager, StatementManager statementManager, ProcedureManager procedureManager, IRepository <ProcedureStepTaskItem, Guid> repositoryPt, IRepository <ProcedureStep, Guid> repositoryProcedureStep) { _taskItemManager = taskItemManager; _statementManager = statementManager; _procedureManager = procedureManager; _repositoryPt = repositoryPt; _repositoryProcedureStep = repositoryProcedureStep; }
private void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Debug.Log("Instance already exists, destroying object!"); Destroy(this); } }
public void EnvVarTest() { string randomStr = Guid.NewGuid().ToString(); ushort randomPort = (ushort)new Random().Next(0, ushort.MaxValue); using var cpm = new ProcedureManager(new DirectoryInfo(randomStr), randomPort); using var command1 = cpm.OpenCommand("cmd.exe", "/c", "echo %ANDROID_ADB_SERVER_PORT%"); Assert.IsTrue(command1.Execute().Output.Contains(randomPort.ToString())); using var command2 = cpm.OpenCommand("cmd.exe", "/c", "echo %PATH%"); Assert.IsTrue(command2.Execute().Output.Contains(randomStr)); }
public ICommandProcedureManager OpenCommandProcedureManager() { lock (concurrentLock) { if (disposedValue) { throw new ObjectDisposedException(nameof(StandardAdbManager)); } var cpm = new ProcedureManager(AdbClientDirectory, (ushort)ServerEndPoint.Port); NotDisposedCpmSet?.Add(cpm); cpm.Disposed += Cpm_Disposed; return(cpm); } }
public void AddMenu(DailyMenu menu) { foreach (Food food in menu.foods) { ProcedureManager.Prepare(procedureName) .AddValue(ProcedureFields.ProcessType, ProcessType.Insert) .AddValue(ProcedureFields.Date, menu.date) .AddValue(ProcedureFields.Name, food.name) .AddValue(ProcedureFields.Calorie, food.calorie) .AddValue(ProcedureFields.Contents, food.contents) .AddValue(ProcedureFields.ImageSrc, food.imageSrc) .Execute(); } }
public void ExitCodeTest() { var cpm = new ProcedureManager(); using var command = cpm.OpenCommand("cmd.exe", "/c", "ping baidu.com"); var result = command.Execute(); Assert.IsTrue(result.ExitCode == 0); using var command127 = cpm.OpenCommand("cmd.exe", "/c", "f**k.exe"); var result127 = command127.Execute(); Assert.IsTrue(result127.ExitCode == 1); }
// Use this for initialization void Start() { ProcedureManager procedureManager = FrameworkEntry.Instance.GetManager <ProcedureManager>(); //Add Procedure Entrance Procedure_Start entranceProcedure = new Procedure_Start(); procedureManager.AddProcedure(entranceProcedure); procedureManager.SetEntranceProcedure(entranceProcedure); //Add another Procedure procedureManager.AddProcedure(new Procedure_Play()); procedureManager.AddProcedure(new Procedure_Over()); procedureManager.CreateProceduresFsm(); }
void Awake() { ProcedureManager procedureManager = FrameworkEntry.Instance.GetManager <ProcedureManager>(); //添加所有流程,并创建状态机 Procedure_1st entranceProcedure = new Procedure_1st(); procedureManager.AddProcedure(entranceProcedure); procedureManager.SetEntranceProcedure(entranceProcedure); procedureManager.AddProcedure(new Procedure_2nd()); procedureManager.AddProcedure(new Procedure_3rd()); procedureManager.CreateProceduresFsm(); }
public void OutputTest() { bool outputReceived = false; var cpm = new ProcedureManager(); using var command = cpm.OpenCommand("cmd.exe", "/c", "ping 127.0.0.1"); command.OutputReceived += (s, e) => { outputReceived = true; }; var result = command.Execute(); Assert.IsTrue(outputReceived); Debug.WriteLine(result.Output); Assert.IsTrue(result.Output.Contains("Pinging")); }
// Start is called before the first frame update void Start() { ProcedureManager proceManager = FrameWorkEntiy.Instance.GetManager <ProcedureManager>(); //添加入口流程 Procedure_Start start = new Procedure_Start(); proceManager.AddProcedure(start); proceManager.SetEntranceProcedure(start); //添加其他流程 proceManager.AddProcedure(new Procedure_Play()); proceManager.AddProcedure(new Procedure_Over()); //创建流程状态机 proceManager.CreateProceduresFsm(); }
public void EnvVarTest() { string randomStr = Guid.NewGuid().ToString(); ushort randomPort = (ushort)new Random().Next(0, ushort.MaxValue); using var cpm = new ProcedureManager(new DirectoryInfo(randomStr), randomPort); using var command1 = cpm.OpenCommand("echo", "%ANDROID_ADB_SERVER_PORT%"); var result = command1.Execute(); Debug.WriteLine(result.Output); Debug.WriteLine(result.ExitCode); Debug.WriteLine(command1.Exception); Assert.IsTrue(result.Output.Contains(randomPort.ToString())); using var command2 = cpm.OpenCommand("echo", "%PATH%"); Assert.IsTrue(command2.Execute().Output.Contains(randomStr)); }
public List <DailyMenu> GetMenuList() { List <DailyMenu> menuList = new List <DailyMenu>(); DataTable dataTable = ProcedureManager.Prepare(procedureName) .AddValue(ProcedureFields.ProcessType, ProcessType.Select) .AddValue(ProcedureFields.Date, DateTime.Now.AddDays(-20)) .ExecuteAndReturnValue(); DailyMenu currentMenu = null; for (int i = 0; i < dataTable.Rows.Count; i++) { DataRow row = dataTable.Rows[i]; string date = ((DateTime)row[0]).ToString("yyyy-MM-dd"); if (currentMenu == null) { currentMenu = new DailyMenu(); currentMenu.date = date; } else if (currentMenu.date != date) { menuList.Add(currentMenu); currentMenu = new DailyMenu(); currentMenu.date = date; } if (currentMenu.foods == null) { currentMenu.foods = new List <Food>(); } currentMenu.foods.Add(new Food() { name = (string)row[1], calorie = (int)row[2], contents = (string)row[3], imageSrc = (string)row[4] }); } return(menuList); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); serializedObject.Update(); ProcedureManager t = (ProcedureManager)target; if (string.IsNullOrEmpty(m_EntranceProcedureTypeName.stringValue)) { EditorGUILayout.HelpBox("没有可用的流程.", MessageType.Error); } else if (EditorApplication.isPlaying) { EditorGUILayout.BeginVertical("box"); EditorGUILayout.LabelField("Current Procedure", t.CurrentProcedure == null ? "None" : t.CurrentProcedure.GetType().ToString()); EditorGUILayout.EndVertical(); } EditorGUILayout.Separator(); //EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode); //{ //GUILayout.Label("Available Procedures", EditorStyles.boldLabel); if (m_ProcedureTypeNames.Length > 0) { //EditorGUILayout.BeginVertical("box"); { foreach (string procedureTypeName in m_ProcedureTypeNames) { //bool selected = m_CurrentAvailableProcedureTypeNames.Contains(procedureTypeName); //if (selected != EditorGUILayout.ToggleLeft(procedureTypeName, selected)) //{ // if (!selected) // { // m_CurrentAvailableProcedureTypeNames.Add(procedureTypeName); // WriteAvailableProcedureTypeNames(); // } // else if (procedureTypeName != m_EntranceProcedureTypeName.stringValue) // { // m_CurrentAvailableProcedureTypeNames.Remove(procedureTypeName); // WriteAvailableProcedureTypeNames(); // } //} if (!m_CurrentAvailableProcedureTypeNames.Contains(procedureTypeName)) { m_CurrentAvailableProcedureTypeNames.Add(procedureTypeName); WriteAvailableProcedureTypeNames(); } } } //EditorGUILayout.EndVertical(); } else { EditorGUILayout.HelpBox("There is no available procedure.", MessageType.Warning); } if (m_CurrentAvailableProcedureTypeNames.Count > 0) { //EditorGUILayout.Separator(); int selectedIndex = EditorGUILayout.Popup("Entrance Procedure", m_EntranceProcedureIndex, m_CurrentAvailableProcedureTypeNames.ToArray()); if (selectedIndex != m_EntranceProcedureIndex) { m_EntranceProcedureIndex = selectedIndex; m_EntranceProcedureTypeName.stringValue = m_CurrentAvailableProcedureTypeNames[selectedIndex]; } } else { EditorGUILayout.HelpBox("Select available procedures first.", MessageType.Info); } //} EditorGUI.EndDisabledGroup(); serializedObject.ApplyModifiedProperties(); Repaint(); }
protected override void OnUpdate() { base.OnUpdate(); if (lastLoadState != loadState) { lastLoadState = loadState; switch (loadState) { case LoadState.None: loadState = LoadState.CheckValid; break; case LoadState.CheckValid: SceneTableSetting setting = SceneTableSettings.Get(nextSceneID); if (setting == null) { Debug.LogError("要加载的场景不存在表中"); loadState = LoadState.Failed; return; } sceneTable = setting; loadState = LoadState.CloseForms; break; case LoadState.CloseForms: Game.UI.CloaseAllForm(Table.Id); loadState = LoadState.LoadScene; break; case LoadState.LoadScene: LoadScene(nextSceneID); break; case LoadState.ClearMemery: ClearMemery(); loadState = LoadState.InitNextProcedure; break; case LoadState.InitNextProcedure: if (sceneTable.Procedure != "NULL") { ProcedureManager.ChangeProcedure(sceneTable.Procedure); } break; case LoadState.Success: Game.Sound.StopAll(sceneTable.BGM); Game.Sound.Play(sceneTable.BGM); break; case LoadState.Failed: break; default: break; } } if (progress < 100) { progress += 3; } if (progress >= 100f * ((float)loadState / (float)LoadState.Success)) { progress = 100f * ((float)loadState / (float)LoadState.Success); } sliderProgress.value = progress / 100f; if (progress >= 100f) { Game.UI.CloseForm <WND_Loading>(); } }
public abstract void OnLeave(ProcedureManager manager);
public abstract void Update(ProcedureManager manager);
public abstract void OnEnter(ProcedureManager manager);
public abstract Boolean Init(ProcedureManager manager);