Beispiel #1
0
        private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            var s = sender as StatisticsPanelViewModel <TSubject>;

            if (s == null)
            {
                return;
            }
            if (e.PropertyName == "Project")
            {
                if (Project != null && Project.Schedule != null)
                {
                    ObjectList         = GetCollection();
                    _subjectDictionary = new Dictionary <TSubject, int>();
                    for (int i = 0; i < ObjectList.Count; i++)
                    {
                        _subjectDictionary.Add(ObjectList[i], i);
                    }

                    if (ObjectList.Any())
                    {
                        SelectedItem = ObjectList.First();
                    }
                }
            }
            else if (e.PropertyName == "SelectedItem")
            {
                var stat = GetStatistic();
                StatisticOnSelected = stat != null ? stat[_subjectDictionary[SelectedItem]] : null;
            }
            else if (e.PropertyName == "StatisticOnSelected")
            {
                //MessageBox.Show(StatisticOnSelected.CountOfClassesPerWeek + " ");
            }
        }
Beispiel #2
0
        public void ProcessNewCards(DeckRegularDict <RegularRummyCard> thisCol)
        {
            if (ObjectList.Count != 8)
            {
                throw new BasicBlankException("Must have 8 cards");
            }
            if (thisCol.Count > 2)
            {
                throw new BasicBlankException("There cannot be more than 2 new cards added");
            }
            var newList = ObjectList.Where(items => items.Visible == false).ToRegularDeckDict();
            int x       = 0;

            newList.ForEach(oldCard =>
            {
                RegularRummyCard newCard = new RegularRummyCard();
                newCard.Populate(thisCol[x].Deck);
                TradeObject(oldCard.Deck, newCard);
                x++;
            });
            if (ObjectList.Any(items => items.Visible == false))
            {
                throw new BasicBlankException("The card was not changed.  Find out what happened");
            }
        }
Beispiel #3
0
 public async Task MakeMoveAsync(int space)
 {
     _command.IsExecuting = true;
     if (_mainGame !.SingleInfo !.ObjectList.Any(x => x.Index == space) == false)
     {
         return;
     }
     _mainGame !.OpenMove();
     if (_basicData !.MultiPlayer == true)
     {
         await _network !.SendMoveAsync(space + 7); //because reversed.
     }
     await GameBoard1 !.AnimateMoveAsync(space);
 }
Beispiel #4
0
        public string WriteDefaultLine(bool terminate, int fieldNum)
        {
            List <string> options = new List <string>();

            if (!string.IsNullOrWhiteSpace(Units))
            {
                options.Add($"{{{Units}}}");
            }
            if (HasDefault)
            {
                options.Add($"Def: {Default}");
            }
            if (Keys.Any())
            {
                options.Add($"[{string.Join(", ", Keys)}]");
            }
            if (ReferenceList.Any())
            {
                options.Add($"RefList: [{string.Join(", ", ReferenceList)}]");
            }
            if (ReferenceClassList.Any())
            {
                options.Add($"RefClassList: [{string.Join(", ", ReferenceClassList)}]");
            }
            if (ObjectList.Any())
            {
                options.Add($"[{string.Join(", ", ObjectList)}]");
            }
            if (AutoCalculatable)
            {
                options.Add("AC");
            }
            if (AutoSizeable)
            {
                options.Add("AS");
            }
            if (Required)
            {
                options.Add("REQ");
            }
            options.Add($"#{fieldNum}");

            return($"  {(HasDefault ? Default : "")}{(terminate ? ";" : ",")}   ! {Name} {string.Join(", ", options)}\n");
        }