コード例 #1
0
ファイル: Home.cs プロジェクト: dested/DSTD-Web-Server
 private void Fooabr(Control sender)
 {
     ((Button)sender.GetControlByID(Sender)).label = ((Variable)sender.GetControlByID("WhosTurn")).Value;
     if (((Variable)sender.GetControlByID("WhosTurn")).Value == "X") {
         ((Variable)sender.GetControlByID("WhosTurn")).Value = "O";
     }
     else
         ((Variable)sender.GetControlByID("WhosTurn")).Value = "X";
 }
コード例 #2
0
        public void RandomClick(Control sender)
        {
            string[] str1 = new[] { "top", "middle", "bottom" };
            string[] str2 = new[] { "left", "middle", "right" };

            int i1 = myHelper.RANDOM(0, 3);
            int i2 = myHelper.RANDOM(0, 3);

            if (!((Button)sender.GetControlByID(str1[i1] + str2[i2])).Enabled) {
                RandomClick(sender);
                return;
            }
            ((Button)sender.GetControlByID(str1[i1] + str2[i2])).Click();
        }
コード例 #3
0
ファイル: Control.cs プロジェクト: dested/DSTD-Web-Server
 public static string GetIDFromid(Control p, string where)
 {
     Control n = p.GetControlByID(where);
     if (n != null) {
         if (n.id == where) {
             return n.ID;
         }
     }
     return where;
 }
コード例 #4
0
ファイル: Home.cs プロジェクト: dested/DSTD-Web-Server
        void InformationToSend_Load(Control sender)
        {
            if (!Page.IsPostBack) {
                ((Variable)sender.GetControlByID("WhosTurn")).Value = "X";
            }
            else {
                if (!string.IsNullOrEmpty(Sender)) {
                    if (Sender.Contains("clicktimer")) {
                        string[] str1 = new[] { "top", "middle", "bottom" };
                        string[] str2 = new[] { "left", "middle", "right" };

                        int i1 = myHelper.RANDOM(0, 3);
                        int i2 = myHelper.RANDOM(0, 3);

                        ((Button)sender.GetControlByID(str1[i1] + str2[i2])).label = ((Variable)sender.GetControlByID("WhosTurn")).Value;
                    }
                    else
                        ((Button)sender.GetControlByID(Sender)).label = ((Variable)sender.GetControlByID("WhosTurn")).Value;
                    if (((Variable)sender.GetControlByID("WhosTurn")).Value == "X") {
                        ((Variable)sender.GetControlByID("WhosTurn")).Value = "O";
                    }
                    else
                        ((Variable)sender.GetControlByID("WhosTurn")).Value = "X";

                }
            }
        }