List <FileInfo> m_lstSelPathList = new List <FileInfo>(); //選択中のセルリスト #endregion #region コンストラクタ public MainForm( ) { InitializeComponent(); // 各メンバーの初期化 m_nSort = 0; m_nSortMax = m_arySortType.Length; rdoSearch.Images = imgRadioIco; // 設定情報を読み込む m_objSetting = Settings.Load(); // リストのカラム幅をリセット(リストの幅に合わせる) lsvResultBox.Columns[0].Width = -2; // ファイル検索クラス m_objFS = new FileSearcher(); m_objFS.Progress += Bgw_ProgressChanged; m_objFS.RunWorkCompleted += Bgw_RunWorkerCompleted; // ツリービュー trvDir.AddNodeRangeComplete += TrvDir_AddNodeRangeComplete; trvDir.AddRangeProgress += TrvDir_AddRangeProgress; stat = ProcState.Default; }
public static bool IsSignatureEqual(ProcState a, ProcState b, DbDriver dbDriver) { if (object.ReferenceEquals(a, b)) { return(true); } if (a == null || b == null) { return(false); } var aFunc = a as FunctionState; var bFunc = b as FunctionState; if (aFunc != null && bFunc != null) { // If they're both functions, the return types need to match. if (!dbDriver.StringEquals(aFunc.ReturnType, bFunc.ReturnType)) { return(false); } } else if (aFunc != null || bFunc != null) { // If one of them is a function but NOT both, they aren't equal. return(false); } return(Enumerable.SequenceEqual(a.Parameters, b.Parameters, ProcParam.GetComparer(dbDriver))); }
void stateWait() { moveIntervalFrame--; if (moveIntervalFrame <= 0) { moveToGoal(); procState = stateMove; } }
internal void Clone(ProcState original, Vector3 position, float angle, Action action) { if (!Enabled) { return; } Logic.Clone((MoveableProc)original.instance, position, angle, action); }
public Task <DreamValue> Call(DreamProc proc, DreamObject src, DreamObject usr, DreamProcArguments arguments) { _callTcs = new(); _callProcNotify = proc.CreateState(Thread, src, usr, arguments); // The field may be mutated by SafeResume, so cache the task var callTcs = _callTcs; SafeResume(); return(callTcs.Task); }
public static bool IsTypeEqual(ProcState a, ProcState b) { if (object.ReferenceEquals(a, b)) { return(true); } if (a == null || b == null) { return(false); } return((a is FunctionState) == (b is FunctionState)); }
public static bool IsEqual(ProcState a, ProcState b, DbDriver dbDriver) { if (object.ReferenceEquals(a, b)) { return(true); } if (a == null || b == null) { return(false); } // We do an exact, case-sensitive comparison of the body rather than using the database's usually case-insensitive // version because it's actual code, which means it may contain literal strings whose case matters // (not to mention that the programmer may care about case for stylistic reasons, or in comments) return(IsSignatureEqual(a, b, dbDriver) && normalizeNewlines(a.Body.Trim()) == normalizeNewlines(b.Body.Trim())); }
void stateMove() { NavMeshAgent agent = GetComponent <NavMeshAgent>(); if (agent == null) { return; } if ((moveGoal - transform.position).magnitude < 0.05f) //if(agent.velocity.magnitude < 0.0001f) { //agent.Stop(); JerboaCharacter jc = GetComponent <JerboaCharacter>(); jc.Sitdown(); procState = stateWait; setIntervalFrame(); } }
/// <summary> /// 検索ボタン /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnSearch_Click(object sender, EventArgs e) { switch (stat) { case ProcState.Default: cmbRoot.ComboText = cmbRoot.ComboText.Trim('\\') + "\\"; cmbRoot.FIllBoxEnable = false; if (SearchExec()) { stat = ProcState.Execute; btnSearch.Text = "中止"; btnClip.Enabled = false; btnError.Visible = false; } break; case ProcState.Execute: btnSearch.Enabled = false; btnSearch.Text = "中止中..."; m_objFS.Cancel = true; stat = ProcState.Canceling; break; } }
protected override ProcStatus InternalResume() { _inResume = true; // We've just been created, start our task if (_task == null) { // Pull execution of our task outside of StartNew to allow it to inline here _task = InternalResumeAsync(); // Shortcut: If our proc was synchronous, we don't need to schedule // This also means we won't reach Resume on a finished proc through our continuation if (_task.IsCompleted) { if (_task.Exception != null) { throw _task.Exception; } return(ProcStatus.Returned); } // We have to resume now so that the execution context knows we have returned // This should lead to `return ProcStatus.Returned` inside `InternalResume`. _task.ContinueWith( (_, inst) => ((State)inst).SafeResume(), this, TaskScheduler.FromCurrentSynchronizationContext()); } // We need to call a proc. while (_callProcNotify != null || _callResult != null) { if (_callProcNotify != null) { var callProcNotify = _callProcNotify; _callProcNotify = null; Thread.PushProcState(callProcNotify); return(ProcStatus.Called); } // We've just finished calling a proc, notify our task if (_callResult != null) { var callTcs = _callTcs; var callResult = _callResult.Value; _callTcs = null; _callResult = null; callTcs.SetResult(callResult); } } // If the task is finished, we're all done if (_task.IsCompleted) { if (_task.Exception != null) { throw _task.Exception; } return(ProcStatus.Returned); } // Otherwise, we are still pending _inResume = false; return(Thread.HandleDefer()); }
// Use this for initialization void Start() { agent = GetComponent <NavMeshAgent>(); setIntervalFrame(); procState = stateWait; }
// ファイル検索完了後処理 private void Bgw_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { string strCancelMsg = "結果"; pWait.Visible = false; if (m_objFS.ExceptionMsg != "") { btnError.Visible = true; //MessageBox.Show("実行中エラーが発生しました\n" + m_FS.ExeptionMsg); } if (!e.Cancelled) { m_nSort = 0; // 検索対象が、どちらか一方の時は、名前のみソート if (rdoSearch.SelectedIndex != 2) { m_nSortMax = 2; } // 両方の時は、種類順のソート else { m_nSortMax = 4; } try { //trvDir.AddNode(strROOT,3,3); DebugWrite("Start"); trvDir.Visible = false; trvDir.SuspendLayout(); Refresh(); TreeNodeElements[] aryNodeElm = new TreeNodeElements[m_objFS.FolderResult.Count]; for (int nCnt = 0; nCnt < m_objFS.FolderResult.Count; nCnt++) { DirInfo objDirInfo = m_objFS.FolderResult[nCnt]; string strRefPath = objDirInfo.strPath.Replace(cmbRoot.ComboText, strROOT); aryNodeElm[nCnt] = new TreeNodeElements(strRefPath, 0, 2, (objDirInfo.bIsSeach) ? Color.Blue : SystemColors.ControlText); } prgTreeCreate.Maximum = aryNodeElm.Length; trvDir.AddNodeRange(aryNodeElm); /* * // フォルダツリーを作成 * foreach(DirInfo dirInfo in m_objFS.FolderResult) * { * string strRefPath = dirInfo.strPath.Replace(cmbRoot.ComboText, strROOT); * TreeNode node= trvDir.AddNode(strRefPath, 0, 2); * if (dirInfo.bIsSeach) * { * node.ForeColor = Color.Blue; * } * } * trvDir.ResumeLayout(); * trvDir.Visible = true; * * trvDir.SelectedNode = trvDir.FindNode(strROOT); * trvDir.Select(); * DebugWrite("End"); */ } catch (Exception exp1) { MessageBox.Show(exp1.Message); } this.Refresh(); SortProc(); } else { strCancelMsg = "[中断]"; } searching.Text = ""; Cursor.Current = Cursors.Default; // ボタンの表示と動作を元に戻す。 btnClip.Enabled = true; pnl.Enabled = true; btnSearch.Text = "検索"; btnSearch.Enabled = true; cmbRoot.FIllBoxEnable = true; stat = ProcState.Default; lblResult.Text = string.Format("検索{0} {1:#,0}件", strCancelMsg, m_objFS.FileResult.Count); }
protected override ProcStatus InternalResume() { _inResume = true; // We've just been created, start our task if (_task == null) { // Pull execution of our task outside of StartNew to allow it to inline here _task = InternalResumeAsync(); // Shortcut: If our proc was synchronous, we don't need to schedule // This also means we won't reach Resume on a finished proc through our continuation if (_task.IsCompleted) { if (_task.Exception != null) { throw _task.Exception; } return(ProcStatus.Returned); } IProcScheduler procScheduler = IoCManager.Resolve <IProcScheduler>(); _task.ContinueWith( _ => procScheduler.ScheduleAsyncNative(this), TaskScheduler.FromCurrentSynchronizationContext() ); } while (_callProcNotify != null || _callResult != null) { // We need to call a proc. if (_callProcNotify != null) { var callProcNotify = _callProcNotify; _callProcNotify = null; Thread.PushProcState(callProcNotify); return(ProcStatus.Called); } // We've just finished calling a proc, notify our task if (_callResult != null) { var callTcs = _callTcs; var callResult = _callResult.Value; _callTcs = null; _callResult = null; callTcs.SetResult(callResult); } } // If the task is finished, we're all done if (_task.IsCompleted) { if (_task.Exception != null) { throw _task.Exception; } return(ProcStatus.Returned); } // Otherwise, we are still pending _inResume = false; return(Thread.HandleDefer()); }