當前位置: 首頁>>代碼示例>>C#>>正文


C# BaseCell類代碼示例

本文整理匯總了C#中BaseCell的典型用法代碼示例。如果您正苦於以下問題:C# BaseCell類的具體用法?C# BaseCell怎麽用?C# BaseCell使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BaseCell類屬於命名空間,在下文中一共展示了BaseCell類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ColumnIndex

		public void ColumnIndex ()
		{
			DataGridViewCell c = new BaseCell ();
			Assert.AreEqual (-1, c.ColumnIndex, "A1");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.Cells.Add (c);
			dgv.Rows.Add (row);

			Assert.AreEqual (0, dgv.Rows[0].Cells[0].ColumnIndex, "A2");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:14,代碼來源:DataGridViewButtonCellTest.cs

示例2: Awake

    void Awake()
    {
        switch (GetComponent<BaseCell>().celltype) {
            case CellType.STEM_CELL:
                m_baseCell = GetComponent<StemCell>();
                break;
            case CellType.HEAT_CELL:
                m_baseCell = GetComponent<HeatCell>();
                break;
            case CellType.COLD_CELL:
                m_baseCell = GetComponent<ColdCell>();
                break;
            case CellType.HEAT_CELL_TIRE2:
                m_baseCell = GetComponent<Tier2HeatCell>();
                break;
            case CellType.COLD_CELL_TIRE2:
                m_baseCell = GetComponent<Tier2ColdCell>();
                break;
            case CellType.ACIDIC_CELL:
                m_baseCell = GetComponent<AcidicCell>();
                break;
            case CellType.ALKALI_CELL:
                m_baseCell = GetComponent<AlkaliCell>();
                break;
            case CellType.CANCER_CELL:
                m_baseCell = GetComponent<CancerCell>();
                break;
            case CellType.NERVE_CELL:
                m_baseCell = GetComponent<NerveCell>();
                break;
            default:
                break;
        }

        m_visionRange = GetComponent<BaseCell>().fovRadius;
        unitLayerMask = 1 << LayerMask.NameToLayer("Unit");
    }
開發者ID:KewlalaGamez,項目名稱:Apoptosis,代碼行數:37,代碼來源:AITrapCell.cs

示例3: PreferredSize

		public void PreferredSize ()
		{
			DataGridViewCell c = new BaseCell ();
			Assert.AreEqual (new Size (-1, -1), c.PreferredSize, "A1");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.Cells.Add (c);
			dgv.Rows.Add (row);

			Assert.AreEqual (new Size (-1, -1), dgv.Rows[0].Cells[0].PreferredSize, "A2");
			
			// Always returns (-1, -1)
			dgv.Rows[0].Cells[0].Value = "bob";
			Assert.AreEqual (new Size (-1, -1), dgv.Rows[0].Cells[0].PreferredSize, "A3");
		}
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:18,代碼來源:DataGridViewCellTest.cs

示例4: MethodGetInheritedContextMenuStrip

		public void MethodGetInheritedContextMenuStrip ()
		{
			DataGridViewCell c = new BaseCell ();
			Assert.AreEqual (null, c.GetInheritedContextMenuStrip (c.RowIndex), "A1");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.Cells.Add (c);
			dgv.Rows.Add (row);

			Assert.AreEqual (null, dgv.Rows[0].Cells[0].GetInheritedContextMenuStrip (dgv.Rows[0].Cells[0].RowIndex), "A2");

			ContextMenuStrip cms1 = new ContextMenuStrip ();
			cms1.Items.Add ("Moose");
			dgv.ContextMenuStrip = cms1;

			Assert.AreSame (cms1, dgv.Rows[0].Cells[0].GetInheritedContextMenuStrip (dgv.Rows[0].Cells[0].RowIndex), "A3");

			ContextMenuStrip cms2 = new ContextMenuStrip ();
			cms2.Items.Add ("Moose");
			dgv.Columns[0].ContextMenuStrip = cms2;

			Assert.AreSame (cms2, dgv.Rows[0].Cells[0].GetInheritedContextMenuStrip (dgv.Rows[0].Cells[0].RowIndex), "A4");

			dgv.Rows[0].ContextMenuStrip = cms1;
			Assert.AreSame (cms1, dgv.Rows[0].Cells[0].GetInheritedContextMenuStrip (dgv.Rows[0].Cells[0].RowIndex), "A5");

			dgv.Rows[0].Cells[0].ContextMenuStrip = cms2;
			Assert.AreSame (cms2, dgv.Rows[0].Cells[0].GetInheritedContextMenuStrip (dgv.Rows[0].Cells[0].RowIndex), "A6");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:32,代碼來源:DataGridViewButtonCellTest.cs

示例5: MethodGetErrorText

		public void MethodGetErrorText ()
		{
			Bitmap b = new Bitmap (1, 1);
			Graphics g = Graphics.FromImage (b);

			BaseCell c = new BaseCell ();
			Assert.AreEqual (string.Empty, c.PublicGetErrorText (c.RowIndex), "A1");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.Cells.Add (c);
			dgv.Rows.Add (row);

			Assert.AreEqual (string.Empty, (dgv.Rows[0].Cells[0] as BaseCell).PublicGetErrorText (dgv.Rows[0].Cells[0].RowIndex), "A2");
			g.Dispose ();
			b.Dispose ();
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:19,代碼來源:DataGridViewButtonCellTest.cs

示例6: MethodBorderWidths

		public void MethodBorderWidths ()
		{
			BaseCell c = new BaseCell ();

			DataGridViewAdvancedBorderStyle style = new DataGridViewAdvancedBorderStyle ();
			style.Bottom = DataGridViewAdvancedCellBorderStyle.Inset;
			style.Left = DataGridViewAdvancedCellBorderStyle.InsetDouble;
			style.Top = DataGridViewAdvancedCellBorderStyle.None;
			//style.Right = DataGridViewAdvancedCellBorderStyle.NotSet;

			Assert.AreEqual (new Rectangle (2, 0, 0, 1), c.PublicBorderWidths (style), "A1");

			style.Bottom = DataGridViewAdvancedCellBorderStyle.Outset;
			style.Left = DataGridViewAdvancedCellBorderStyle.OutsetDouble;
			style.Right = DataGridViewAdvancedCellBorderStyle.OutsetPartial;
			style.Top = DataGridViewAdvancedCellBorderStyle.Single;

			Assert.AreEqual (new Rectangle (2, 1, 1, 1), c.PublicBorderWidths (style), "A2");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.Cells.Add (c);
			dgv.Rows.Add (row);

			dgv.Rows[0].DividerHeight = 3;
			dgv.Columns[0].DividerWidth = 5;

			Assert.AreEqual (new Rectangle (2, 1, 6, 4), (dgv.Rows[0].Cells[0] as BaseCell).PublicBorderWidths (style), "A3");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:31,代碼來源:DataGridViewButtonCellTest.cs

示例7: Value2

		public void Value2 ()
		{
			DataGridViewCell c = new BaseCell ();
			Assert.AreEqual (null, c.Value, "A1");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.Cells.Add (c);
			dgv.Rows.Add (row);

			Assert.AreEqual (null, dgv.Rows[0].Cells[0].Value, "A2");

			dgv.Rows[0].Cells[0].Value = "bob";
			Assert.AreEqual ("bob", dgv.Rows[0].Cells[0].Value, "A3");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:17,代碼來源:DataGridViewButtonCellTest.cs

示例8: Style

		public void Style ()
		{
			DataGridViewCell c = new BaseCell ();
			Assert.AreEqual (DataGridViewContentAlignment.NotSet, c.Style.Alignment, "A1");
			Assert.AreEqual (Color.Empty, c.Style.BackColor, "A2");
			Assert.AreEqual (DBNull.Value, c.Style.DataSourceNullValue, "A3");
			Assert.AreEqual (null, c.Style.Font, "A4");
			Assert.AreEqual (Color.Empty, c.Style.ForeColor, "A5");
			Assert.AreEqual (string.Empty, c.Style.Format, "A6");
			Assert.AreEqual (Thread.CurrentThread.CurrentCulture, c.Style.FormatProvider, "A7");
			Assert.AreEqual (true, c.Style.IsDataSourceNullValueDefault, "A8");
			Assert.AreEqual (true, c.Style.IsFormatProviderDefault, "A9");
			Assert.AreEqual (true, c.Style.IsNullValueDefault, "A10");
			Assert.AreEqual (string.Empty, c.Style.NullValue, "A11");
			Assert.AreEqual (Padding.Empty, c.Style.Padding, "A12");
			Assert.AreEqual (Color.Empty, c.Style.SelectionBackColor, "A13");
			Assert.AreEqual (Color.Empty, c.Style.SelectionForeColor, "A14");
			Assert.AreEqual (null, c.Style.Tag, "A15");
			Assert.AreEqual (DataGridViewTriState.NotSet, c.Style.WrapMode, "A16");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.Cells.Add (c);
			dgv.Rows.Add (row);

			// Style does not change based on parent
			// (InheritedStyle does)
			Assert.AreEqual (DataGridViewContentAlignment.NotSet, c.Style.Alignment, "A17");
			Assert.AreEqual (Color.Empty, c.Style.BackColor, "A18");
			Assert.AreEqual (DBNull.Value, c.Style.DataSourceNullValue, "A19");
			Assert.AreEqual (null, c.Style.Font, "A20");
			Assert.AreEqual (Color.Empty, c.Style.ForeColor, "A21");
			Assert.AreEqual (string.Empty, c.Style.Format, "A22");
			Assert.AreEqual (Thread.CurrentThread.CurrentCulture, c.Style.FormatProvider, "A23");
			Assert.AreEqual (true, c.Style.IsDataSourceNullValueDefault, "A24");
			Assert.AreEqual (true, c.Style.IsFormatProviderDefault, "A25");
			Assert.AreEqual (true, c.Style.IsNullValueDefault, "A26");
			Assert.AreEqual (string.Empty, c.Style.NullValue, "A27");
			Assert.AreEqual (Padding.Empty, c.Style.Padding, "A28");
			Assert.AreEqual (Color.Empty, c.Style.SelectionBackColor, "A29");
			Assert.AreEqual (Color.Empty, c.Style.SelectionForeColor, "A30");
			Assert.AreEqual (null, c.Style.Tag, "A31");
			Assert.AreEqual (DataGridViewTriState.NotSet, c.Style.WrapMode, "A32");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:46,代碼來源:DataGridViewButtonCellTest.cs

示例9: DefaultNewRowValue

		public void DefaultNewRowValue ()
		{
			DataGridViewCell c = new BaseCell ();
			Assert.AreEqual (null, c.DefaultNewRowValue, "A1");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.Cells.Add (c);
			dgv.Rows.Add (row);

			Assert.AreEqual (null, dgv.Rows[0].Cells[0].DefaultNewRowValue, "A2");
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:14,代碼來源:DataGridViewButtonCellTest.cs

示例10: Load

        //public void Draw(Canvas canvas)
        //{
        //    if (_mapCells == null) { throw new Exception("沒有加載地圖。"); }
        //}
        public bool Load(string filePathName)
        {
            releaseMapBitmap();
            // 加載地圖圖片。
            _mapBitmap = new Bitmap(filePathName);
            if (_mapBitmap.Width < Cols || _mapBitmap.Height < Rows) { return false; }

            for (int x = 0; x < Cols; x++)
            {
                for (int y = 0; y < Rows; y++)
                {
                    System.Drawing.Color c = _mapBitmap.GetPixel(x, y);
                    if (c.R == 255 && c.G == 255 && c.B == 255)	// 白色,地麵
                    {
                        _mapCanvas.Children.Add(new LandCell(x,y));
                    }
                    else
                    {
                        if (c.R == 0 && c.G == 255 && c.B == 0)	// 綠色,樹
                        {
                            _mapCanvas.Children.Add(new TreeCell(x,y));
                        }
                        else
                        {
                            if (c.R == 0 && c.G == 0 && c.B == 255)	// 藍色,怪物進攻路線
                            {
                                _mapCanvas.Children.Add(new PathCell(x,y));
                            }
                            else
                            {
                                if (c.R == 0 && c.G == 0 && c.B == 0)	// 黑色,基地
                                {
                                    //if (_pathCells[x] != null) { throw new Exception("地圖設計錯誤,基地隻能有一個。"); }
                                    _baseCell = new BaseCell(x,y);
                                    _mapCanvas.Children.Add(_baseCell);
                                }
                                else
                                {
                                    if (c.R == 255 && c.G == 0 && c.B == 0)	// 紅色,怪物入口
                                    {
                                        //if (x != 0||_pathCells[0]!=null) { throw new Exception("地圖設計錯誤,怪物入口必須在最左側且隻能有一個入口。"); }
                                        _entryCell = new PathCell(x, y);
                                        _mapCanvas.Children.Add(_entryCell);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            initPathCells();
            initGunCells();
            return true;
        }
開發者ID:MinZhu,項目名稱:Defence,代碼行數:58,代碼來源:Map.cs

示例11: MethodGetErrorIconBounds

		public void MethodGetErrorIconBounds ()
		{
			Bitmap b = new Bitmap (1, 1);
			Graphics g = Graphics.FromImage (b);

			BaseCell c = new BaseCell ();
			c.ErrorText = "Yo!";
			Assert.AreEqual (Rectangle.Empty, c.PublicGetErrorIconBounds (g, c.Style, c.RowIndex), "A1");

			DataGridView dgv = new DataGridView ();
			dgv.Columns.Add ("hi", "there");

			DataGridViewRow row = new DataGridViewRow ();
			row.HeaderCell = c;
			dgv.Rows.Add (row);

			Assert.AreEqual (Rectangle.Empty, (dgv.Rows[0].HeaderCell as BaseCell).PublicGetErrorIconBounds (g, dgv.Rows[0].HeaderCell.InheritedStyle, dgv.Rows[0].HeaderCell.RowIndex), "A2");

			dgv.Rows[0].ErrorText = "Danger!";
			Assert.AreEqual (new Rectangle (24, 5, 12, 11), (dgv.Rows[0].HeaderCell as BaseCell).PublicGetErrorIconBounds (g, dgv.Rows[0].HeaderCell.InheritedStyle, dgv.Rows[0].HeaderCell.RowIndex), "A3");
			Assert.AreEqual ("Danger!", (dgv.Rows[0].HeaderCell as BaseCell).PublicGetErrorText (dgv.Rows[0].HeaderCell.RowIndex), "A4");

			g.Dispose ();
			b.Dispose ();
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:25,代碼來源:DataGridViewRowHeaderTest.cs

示例12: FormattedValueType

		public void FormattedValueType ()
		{
			BaseCell c = new BaseCell ();
			Assert.AreEqual (typeof (bool), c.FormattedValueType, "A1");
			
			c.ThreeState = true;
			Assert.AreEqual (typeof (CheckState), c.FormattedValueType, "A2");
		}
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:8,代碼來源:DataGridViewCheckBoxCellTest.cs

示例13: RemoveDeadCell

 public void RemoveDeadCell(BaseCell _in)
 {
     _in.isSelected = false;
     allSelectableUnits.Remove(_in);
     selectedUnits.Remove(_in);
     CheckSelectedUnits();
 }
開發者ID:KewlalaGamez,項目名稱:Apoptosis,代碼行數:7,代碼來源:PlayerController.cs

示例14: DeselectCell

 public void DeselectCell(BaseCell _in)
 {
     _in.isSelected = false;
     selectedUnits.Remove(_in);
 }
開發者ID:KewlalaGamez,項目名稱:Apoptosis,代碼行數:5,代碼來源:PlayerController.cs

示例15: AddNewCell

    public void AddNewCell(BaseCell _in)
    {
        if (PhotonNetwork.connected && !_in.gameObject.GetPhotonView().isMine)
        {
            allSelectableTargets.Add(_in.gameObject);
        }
        else if (_in.isSinglePlayer && !_in.isMine && !allSelectableTargets.Contains(_in.gameObject))
        {
            allSelectableTargets.Add(_in.gameObject);
        }
        else if (!allSelectableUnits.Contains(_in) && _in.isMine)
        {

            _in.isSelected = true;
            if (!_in.transform.FindChild("FriendlySelector(Clone)"))
            {
                GameObject tFriendlySelector = GameObject.Instantiate(friendlySelector, _in.transform.position, Quaternion.Euler(90.0f, 0.0f, 0.0f)) as GameObject;
                tFriendlySelector.transform.parent = _in.transform;
            }
            allSelectableUnits.Add(_in);
            selectedUnits.Add(_in);
            CheckSelectedUnits();
        }
    }
開發者ID:KewlalaGamez,項目名稱:Apoptosis,代碼行數:24,代碼來源:PlayerController.cs


注:本文中的BaseCell類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。