コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsSuperUser)
            {
                Column1.Visible = false;
                Column2.AddCssClasses("wide");
            }

            if (!IsPostBack)
            {
                const string title = "Master Administration";
                Page.Title   = title;
                H1.InnerHtml = title;

                NoJurisdiction.CreateStateLinks("/admin/?state={StateCode}");
                NoJurisdiction.SetHead("Links to State Administration Pages");

                if (IsSuperUser)
                {
                    var sampleBallotDialogEnabled = DB.Vote.Master.GetPresentGetFutureSampleBallotsDialog(false);
                    var nagsEnabled = DonationNagsControl.GetIsNaggingEnabled(false);
                    if (!sampleBallotDialogEnabled || !nagsEnabled)
                    {
                        if (!sampleBallotDialogEnabled)
                        {
                            new HtmlP {
                                InnerText = "Ballot Choices Dialogs are disabled"
                            }
                        }
コード例 #2
0
 public void ShouldBeValid(int c1, int c2, int c3, int c4)
 {
     Column1.ShouldBe(c1);
     Column2.ShouldBe(c2);
     Column3.ShouldBe(c3);
     Column4.ShouldBe(c4);
 }
コード例 #3
0
ファイル: Matrix.cs プロジェクト: yonder/CryMono
        public int IsOrthonormalRH(float threshold = 0.001f)
        {
            var a = (int)System.Convert.ChangeType(Column0.IsEquivalent(Column1 % Column2, threshold), typeof(int));
            var b = (int)System.Convert.ChangeType(Column1.IsEquivalent(Column2 % Column0, threshold), typeof(int));
            var c = (int)System.Convert.ChangeType(Column2.IsEquivalent(Column0 % Column1, threshold), typeof(int));

            return(a & b & c);
        }
コード例 #4
0
 public void Dispose()
 {
     Column1?.Dispose();
     Column2?.Dispose();
     Column3?.Dispose();
     Column4?.Dispose();
     Column5?.Dispose();
     Column0?.Dispose();
     Column6?.Dispose();
     Column7?.Dispose();
     Column8?.Dispose();
     Column9?.Dispose();
     Column10?.Dispose();
     Column11?.Dispose();
     Column12?.Dispose();
     Column13?.Dispose();
     Column14?.Dispose();
     Column15?.Dispose();
     Column16?.Dispose();
     Column17?.Dispose();
     Column18?.Dispose();
     Column19?.Dispose();
     Column20?.Dispose();
     Column21?.Dispose();
     Column22?.Dispose();
     Column23?.Dispose();
     Column24?.Dispose();
     Column25?.Dispose();
     Column26?.Dispose();
     Column27?.Dispose();
     Column28?.Dispose();
     Column29?.Dispose();
     Column30?.Dispose();
     Column31?.Dispose();
     Column32?.Dispose();
     Column33?.Dispose();
     Column34?.Dispose();
     Column35?.Dispose();
     Column36?.Dispose();
     Column37?.Dispose();
     Column38?.Dispose();
     Column39?.Dispose();
     Column40?.Dispose();
     Column41?.Dispose();
     Column42?.Dispose();
     Column43?.Dispose();
     Column44?.Dispose();
     Column45?.Dispose();
     Column46?.Dispose();
     Column47?.Dispose();
     Column48?.Dispose();
     Column49?.Dispose();
     Column50?.Dispose();
     Column51?.Dispose();
     Column52?.Dispose();
 }
コード例 #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = Column0.GetHashCode() * 31 + Column1.GetHashCode();
         hash = hash * 31 + Column2.GetHashCode();
         hash = hash * 31 + Column3.GetHashCode();
         return(hash);
     }
 }
コード例 #6
0
 /// <summary>
 /// 生成单元格列
 /// </summary>
 /// <param name="dic">单元格一级列头集合</param>
 /// <param name="dic2">单元格二级列头集合</param>
 public void BuildGridColumns(Dictionary <String, String> dic, Dictionary <String, String> dic2)
 {
     if (dic == null || dic2 == null)
     {
         return;
     }
     {
         ClearColumns();
         BuildGridHeader();
         var i = 0;
         foreach (var item in dic)
         {
             var columnInfo = new Column {
                 Key = item.Key, Name = item.Value
             };
             var j = 0;
             foreach (var item2 in dic2)
             {
                 var column2Info = new Column2 {
                     Key = item2.Key, Name = item2.Value
                 };
                 var col = new ColumnDefinition {
                     MinWidth = ColMinWidth, Width = GridLength.Auto
                 };
                 var element4ColProperty = BuildRowColumnContent(item2.Value);
                 Grid.ColumnDefinitions.Add(col);
                 Grid.SetColumn(element4ColProperty, (i * dic2.Count) + (j + 1));
                 Grid.SetRow(element4ColProperty, 1);
                 Grid.Children.Add(element4ColProperty);
                 column2Info.ColumnDefinition = col;
                 column2Info.Element          = element4ColProperty;
                 columnInfo.ColumnDefinitions.Add(column2Info);
                 j++;
             }
             var element4Col = BuildRowColumnContent(item.Value);
             Grid.SetColumn(element4Col, (i * dic2.Count) + 1);
             Grid.SetColumnSpan(element4Col, dic2.Count);
             Grid.SetRow(element4Col, 0);
             Grid.Children.Add(element4Col);
             columnInfo.Element = element4Col;
             ColumnCols.Add(columnInfo);
             i++;
         }
         _columnInit = true;
         BuildContentGrid();
     }
 }
コード例 #7
0
        void SelectCol(int ci)
        {
            GetColumns();
            if (ci >= Columns.Count)
            {
                ci--;
            }
            if (ci < 0)
            {
                ci = 0;
            }
            if (ci == 0)
            {
                Column1.Focus();
            }
            else if (ci == 1)
            {
                Column2.Focus();
            }
            else if (ci == 2)
            {
                Column3.Focus();
            }
            else if (ci == 3)
            {
                Column4.Focus();
            }
            else if (ci == 4)
            {
                Column5.Focus();
            }
            else if (ci == 5)
            {
                Column6.Focus();
            }

            SelectedCol = ci;
        }
コード例 #8
0
ファイル: ExtDataGrid.cs プロジェクト: caocf/workspace-kepler
        /// <summary>
        /// 生成单元格列
        /// </summary>
        /// <param name="dic">单元格一级列头集合</param>
        /// <param name="dic2">单元格二级列头集合</param>
        public void BuildGridColumns(Dictionary<String, String> dic, Dictionary<String, String> dic2)
        {
            if (dic == null || dic2 == null) return;
            {
                ClearColumns();
                BuildGridHeader();
                var i = 0;
                foreach (var item in dic)
                {
                    var columnInfo = new Column { Key = item.Key, Name = item.Value };
                    var j = 0;
                    foreach (var item2 in dic2)
                    {

                        var column2Info = new Column2 { Key = item2.Key, Name = item2.Value };
                        var col = new ColumnDefinition { MinWidth = ColMinWidth, Width = GridLength.Auto };
                        var element4ColProperty = BuildRowColumnContent(item2.Value);
                        Grid.ColumnDefinitions.Add(col);
                        Grid.SetColumn(element4ColProperty, (i * dic2.Count) + (j + 1));
                        Grid.SetRow(element4ColProperty, 1);
                        Grid.Children.Add(element4ColProperty);
                        column2Info.ColumnDefinition = col;
                        column2Info.Element = element4ColProperty;
                        columnInfo.ColumnDefinitions.Add(column2Info);
                        j++;
                    }
                    var element4Col = BuildRowColumnContent(item.Value);
                    Grid.SetColumn(element4Col, (i * dic2.Count) + 1);
                    Grid.SetColumnSpan(element4Col, dic2.Count);
                    Grid.SetRow(element4Col, 0);
                    Grid.Children.Add(element4Col);
                    columnInfo.Element = element4Col;
                    ColumnCols.Add(columnInfo);
                    i++;
                }
                _columnInit = true;
                BuildContentGrid();
            }
        }
コード例 #9
0
        private void CheckWinner()
        {
            int Row1, Row2, Row3;
            int Column1, Column2, Column3;
            int Diagonal1, Diagonal2;

            Row1 = GameArrayGrid[0] + GameArrayGrid[1] + GameArrayGrid[2];
            Row2 = GameArrayGrid[3] + GameArrayGrid[4] + GameArrayGrid[5];
            Row3 = GameArrayGrid[6] + GameArrayGrid[7] + GameArrayGrid[8];

            Column1 = GameArrayGrid[0] + GameArrayGrid[3] + GameArrayGrid[6];
            Column2 = GameArrayGrid[1] + GameArrayGrid[4] + GameArrayGrid[7];
            Column3 = GameArrayGrid[2] + GameArrayGrid[5] + GameArrayGrid[8];

            Diagonal1 = GameArrayGrid[0] + GameArrayGrid[4] + GameArrayGrid[8];
            Diagonal2 = GameArrayGrid[2] + GameArrayGrid[4] + GameArrayGrid[6];

            Console.WriteLine("Row 1: " + Row1 + "\n" +
                              "Row 2: " + Row2 + "\n" +
                              "Row 3: " + Row3 + "\n" +
                              "Column 1: " + Column1 + "\n" +
                              "Column 2: " + Column2 + "\n" +
                              "Column 3: " + Column3 + "\n" +
                              "Diagonal 1: " + Diagonal1 + "\n" +
                              "Diagonal 2: " + Diagonal2 + "\n");

            if (Row1.Equals(3) || Row2.Equals(3) || Row3.Equals(3)) // CHECK FOR ROW WIN FOR O
            {
                label_WinnerText.Visible = true;
                label_WinnerText.Text    = "Winner: Player O";
                disableButtons();
            }
            else if (Row1.Equals(-3) || Row2.Equals(-3) || Row3.Equals(-3)) //CHECK FOR ROW WIN FOR X
            {
                label_WinnerText.Visible = true;
                label_WinnerText.Text    = "Winner: Player X";
                disableButtons();
            }
            else if (Column1.Equals(3) || Column2.Equals(3) || Column3.Equals(3))
            {
                label_WinnerText.Visible = true;
                label_WinnerText.Text    = "Winner: Player O";
                disableButtons();
            }
            else if (Column1.Equals(-3) || Column2.Equals(-3) || Column3.Equals(-3))
            {
                label_WinnerText.Visible = true;
                label_WinnerText.Text    = "Winner: Player X";
                disableButtons();
            }
            else if (Diagonal1.Equals(3) || Diagonal2.Equals(3))
            {
                label_WinnerText.Visible = true;
                label_WinnerText.Text    = "Winner: Player O";
                disableButtons();
            }
            else if (Diagonal1.Equals(-3) || Diagonal2.Equals(-3))
            {
                label_WinnerText.Visible = true;
                label_WinnerText.Text    = "Winner: Player X";
                disableButtons();
            }
            else if (isBoardFull())
            {
                label_WinnerText.Visible = true;
                label_WinnerText.Text    = "It's a Draw!";
                disableButtons();
            }
        }
コード例 #10
0
 public bool Equals(Matrix4x4 other)
 {
     return(Column0.Equals(other.Column0) && Column1.Equals(other.Column1) && Column2.Equals(other.Column2) && Column3.Equals(other.Column3));
 }
コード例 #11
0
 public bool IsValid()
 {
     return(Column0.IsValid() && Column1.IsValid() && Column2.IsValid() && Column3.IsValid());
 }
コード例 #12
0
    IEnumerator ApplyPositions()
    {
        yield return(new WaitUntil(() => GameManager.k_Manager.CharactersUp));

        yield return(new WaitUntil(() => GameManager.k_Manager.EnemiesUp));

        foreach (Transform tp_spawn in transform)
        {
            if (tp_spawn.name == "SpawnPoint" && tp_spawn.transform.FindChild("Character(Clone)") != null)
            {
                while (true)
                {
                    if (Column1.Contains(tp_spawn))
                    {
                        SetPosition(tp_spawn, 1, true);
                        break;
                    }
                    if (Column2.Contains(tp_spawn))
                    {
                        SetPosition(tp_spawn, 2, true);
                        break;
                    }
                    if (Column3.Contains(tp_spawn))
                    {
                        SetPosition(tp_spawn, 3, true);
                        break;
                    }
                    if (Column4.Contains(tp_spawn))
                    {
                        SetPosition(tp_spawn, 4, true);
                        break;
                    }
                }
                while (true)
                {
                    if (Row1.Contains(tp_spawn))
                    {
                        SetPosition(tp_spawn, 1, false);
                        break;
                    }
                    if (Row2.Contains(tp_spawn))
                    {
                        SetPosition(tp_spawn, 2, false);
                        break;
                    }
                    if (Row3.Contains(tp_spawn))
                    {
                        SetPosition(tp_spawn, 3, false);
                        break;
                    }
                    if (Row4.Contains(tp_spawn))
                    {
                        SetPosition(tp_spawn, 4, false);
                        break;
                    }
                }

                ApplyPositionToCharacter(tp_spawn.transform.FindChild("Character(Clone)").GetComponent <CharacterClass> ());
            }
        }

        GameManager.k_Manager.Applied = true;
    }