コード例 #1
0
 private void UF_CallDelegateEvent(DelegateMethod method)
 {
     if (method != null)
     {
         method.Invoke(this);
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: wangyu190810/some_lang
 public void RunDelegateMethods()
 {
     if (delegateMethod != null)
     {
         Console.WriteLine("---------");
         delegateMethod.Invoke();
         Console.WriteLine("---------");
     }
 }
    /// <summary>
    /// ターン終了時に呼ぶ
    /// </summary>
    public static void EndTurn()
    {
        // ターンを開始せずに終了した場合はまず強制的にターンを開始する
        if (!m_isTurnStarted)
        {
            BeginTurn();
        }

        OnEndTurn?.Invoke();
        m_isTurnStarted = false;
    }
コード例 #4
0
        public void RunDelegateMethods()
        {
            if (delegateMethod != null)
            {
                Console.WriteLine("---------");

                delegateMethod();
                //what's the difference between up and down?  most of cases, they are same
                delegateMethod.Invoke();
                Console.WriteLine("---------");
            }
        }
コード例 #5
0
        static void main(string[] args)
        {
            //Basic Func:
            DelegateEg     obj1 = new DelegateEg();
            DelegateMethod del  = obj1.AddMe; // no param

            del(10, 20);
            del.Invoke(10, 20);  // same as above

            //Multi Cast
            DelegateEg     obj2 = new DelegateEg();
            DelegateMethod del2 = obj2.AddMe;

            del2 += obj2.SubMe;  // Appended
            del2(600, 400);
        }
コード例 #6
0
        public void DoTask()
        {
            mState = TaskState.Running;

            if (TransactionProcessing())
            {
                mState = TaskState.Completion;
                if (mCodeWhenCompleted != null)
                {
                    mCodeWhenCompleted.Invoke();
                }
                if (mNextTask != null)
                {
                    mNextTask.DoTask();
                }
            }
            else
            {
                mState = TaskState.Failed;
            }
        }
コード例 #7
0
ファイル: FoldoutNode.cs プロジェクト: isoundy000/Card_All
        public void Draw()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Space(15 * this.Depth);

            string str = "+";

            if (this.Fold)
            {
                str = " -";
            }
            if (this.Select)
            {
                str = str + "[" + this.Text + "]";
            }
            else
            {
                str = str + this.Text;
            }
            if (GUILayout.Button(str, GUI.skin.GetStyle("Label")))
            {
                this.Fold = !this.Fold;
                mCallback.Invoke(this);
            }
            GUILayout.EndHorizontal();

            if (this.Fold)
            {
                foreach (FoldoutFolder folder in this.Folders)
                {
                    folder.Draw();
                }
                foreach (FoldoutNode node in this.Nodes)
                {
                    node.Draw();
                }
            }
        }
コード例 #8
0
ファイル: FoldoutNode.cs プロジェクト: isoundy000/Card_All
        public void Draw()
        {
            if (!this.Hide)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Space(15 * this.Depth);

                string str = "";
                if (this.Select)
                {
                    str = str + "[" + this.Text + "]";
                }
                else
                {
                    str = str + this.Text;
                }
                if (GUILayout.Button(str, GUI.skin.GetStyle("Label")))
                {
                    mCallback.Invoke(this);
                }
                GUILayout.EndHorizontal();
            }
        }
コード例 #9
0
 public int Execute(DelegateMethod method, DataSet data)
 {
     int ret = -1;
     try
     {
         this.dbHelper.Open();
         this.dbHelper.BeginTransaction();
         ret = method.Invoke(data);
         this.dbHelper.Commit();
     }
     #if Npgsql
     catch (NpgsqlException e)
     {
         this.dbHelper.Rollback();
         LogUtility.WriteLogError("", e);
         throw new DBException("", e);
     }
     #else
     catch (NpgsqlException e)
     {
         this.dbHelper.Rollback();
         LogUtility.WriteLogError("", e);
         throw new DBException("", e);
     }
     #endif
     catch (Exception e)
     {
         this.dbHelper.Rollback();
         LogUtility.WriteLogError("", e);
         throw new DBException("", e);
     }
     finally
     {
         this.dbHelper.Close();
     }
     return ret;
 }
 /// <summary>
 /// ターン開始時に呼ぶ
 /// </summary>
 public static void BeginTurn()
 {
     OnBeginTurn?.Invoke();
     m_isTurnStarted = true;
 }