Exemple #1
0
        public MarkButtonDTO GetMarkButton(DrawingStandards _standard, MarkTypes _type)
        {
            var mark = markCollection.FirstOrDefault(x => x.standard == _standard && x.type == _type);

            return(new MarkButtonDTO()
            {
                id = mark.id, name = GetMarkDescription(mark.id), picture = mark.picture32
            });
        }
 protected void SetNextPlayerMark()
 {
     if (currentPlayerMark == MarkTypes.Cross)
     {
         currentPlayerMark = MarkTypes.Oval;
     }
     else
     {
         currentPlayerMark = MarkTypes.Cross;
     }
 }
Exemple #3
0
 public static void ShowFormLoaiDiem()
 {
     if (m_MarkTypes == null || m_MarkTypes.IsDisposed)
     {
         m_MarkTypes           = new MarkTypes();
         m_MarkTypes.MdiParent = MainForm.ActiveForm;
         m_MarkTypes.Show();
     }
     else
     {
         m_MarkTypes.Activate();
     }
 }
 public void MarkCell(MarkTypes selectedMarkType)
 {
     if (MarkType == MarkTypes.NotMarked)
     {
         MarkType = selectedMarkType;
         if (OnAfterCellMarked != null)
         {
             OnAfterCellMarked.Invoke(this, new CellMarkedEventArgs {
                 SelectedMarkType = selectedMarkType
             });
         }
     }
 }
Exemple #5
0
        private MarkDTO GetMarkDTO(DrawingStandards _standard, MarkTypes _type)
        {
            var item = markCollection.FirstOrDefault(x => x.standard.Equals(_standard) && x.type.Equals(_type));

            if (item.Equals(default(MarkDTO)))
            {
                throw new Exception("Brak koty wysokościowej " + _type.ToString());
            }
            else
            {
                return(item);
            }
        }
Exemple #6
0
        public Bitmap GetIcon(DrawingStandards _standard, MarkTypes _type, IconSize _size)
        {
            Dictionary <MarkTypes, Dictionary <IconSize, Bitmap> > key1;

            if (data.TryGetValue(_standard, out key1))
            {
                Dictionary <IconSize, Bitmap> key2;
                if (key1.TryGetValue(_type, out key2))
                {
                    return(key2[_size]);
                }
            }

            return(DefaultIcon);
        }
Exemple #7
0
        public MarkTypes[][] GenerateDefaultPlayerMarksTable(int tableRows, int tableColumns)
        {
            var marks = new MarkTypes[tableRows][];

            for (var row = 0; row < tableRows; ++row)
            {
                marks[row] = new MarkTypes[tableColumns];

                for (var col = 0; col < tableColumns; ++col)
                {
                    marks[row][col] = MarkTypes.None;
                }
            }

            return(marks);
        }
        public static GameModel.MarkTypes FromContract(MarkTypes markType)
        {
            switch (markType)
            {
            case MarkTypes.Empty:
                return(GameModel.MarkTypes.Empty);

            case MarkTypes.None:
                return(GameModel.MarkTypes.None);

            case MarkTypes.Unknown:
                return(GameModel.MarkTypes.Unknown);

            default:
                throw new ArgumentOutOfRangeException(nameof(markType), $"The value {(int)markType} is not valid for this parameter.");
            }
        }
Exemple #9
0
 /// <summary>
 /// Get one mark by mark type
 /// </summary>
 /// <param name="markType">Mark type</param>
 /// <returns>Mark</returns>
 public Mark MarkGet(MarkTypes markType)
 {
     return MarkGet(markType.ToString());
 }
Exemple #10
0
 public Bitmap GetIcon(DrawingStandards standard, MarkTypes type)
 {
     return(GetIcon(standard, type, IconSize.medium));
 }
Exemple #11
0
 public string GetMarkDescription(DrawingStandards _standard, MarkTypes _type)
 {
     return(markTypes[GetMarkDTO(_standard, _type).type]);
 }