Esempio n. 1
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            Families families = new Families();

            Person person1 = new Person();

            person1.ID         = 1;
            person1.PersonName = "小三";
            People people1 = new People();

            people1.Add(person1);
            Family family1 = new Family();

            family1.ID         = 1;
            family1.FamilyName = "张三家";
            family1.Merbers    = people1;
            families.Add(family1);
            Like like1 = new Like();

            like1.LikeName = "潇洒";
            Likes likes = new Likes();

            likes.Add(like1);
            person1.PLike = likes;

            Person person2 = new Person();

            person2.ID         = 2;
            person2.PersonName = "小四";
            People people2 = new People();

            people2.Add(person2);
            Family family2 = new Family();

            family2.FamilyName = "李四家";
            family2.ID         = 2;
            family2.Merbers    = people2;
            families.Add(family2);
            Like like2 = new Like();

            like2.LikeName = "干活";
            Likes likes2 = new Likes();

            likes2.Add(like2);
            person2.PLike = likes2;

            this.gd.DataContext = families;
        }
Esempio n. 2
0
 public void Bound(string name, Func <dynamic, HelperResult> predicate)
 {
     Families.Add(new ContextFamily()
     {
         Name = name, Predicate = predicate
     });
 }
Esempio n. 3
0
        public void AddNewFamily(Family family)
        {
            int max = Families.Max(family => family.Id);

            family.Id = (++max);
            Families.Add(family);
            SaveChanges();
        }
        public async void Get()
        {
            var jData = await DataService.Get($"Family/{Preferences.Get("TeamId", "")}");


            if (jData == "ConnectionError")
            {
                StandardMessagesDisplay.NoConnectionToast();
            }
            else if (jData == "null")
            {
                StandardMessagesDisplay.NoDataDisplayMessage();
            }
            else if (jData == "Error")
            {
                StandardMessagesDisplay.Error();
            }
            else if (jData == "ErrorTracked")
            {
                StandardMessagesDisplay.ErrorTracked();
            }
            else
            {
                try
                {
                    var data = JsonConvert.DeserializeObject <Dictionary <string, FamilyModel> >(jData);

                    if (data != null)
                    {
                        foreach (KeyValuePair <string, FamilyModel> item in data)
                        {
                            StaticDataStore.FamilyNumbers.Add(item.Value.HouseNo);
                            Families?.Add(
                                new FamilyModel
                            {
                                FId         = item.Key.ToString(),
                                Id          = item.Value.Id,
                                ParentName  = item.Value.ParentName,
                                PhoneNumber = item.Value.PhoneNumber,
                                HouseNo     = item.Value.HouseNo
                            }
                                );
                        }
                    }

                    if (Families != null)
                    {
                        StaticDataStore.Families = Families;
                        StaticDataStore.TeamStats.TotalHouseholds = Families.Count;
                    }
                }
                catch (Exception ex)
                {
                    Crashes.TrackError(ex);
                    StandardMessagesDisplay.InputToast(ex.Message);
                }
            }
        }
Esempio n. 5
0
 private void LoadPartGen()
 {
     Logger.Instance.WriteVerbose("Loading Xilinx Part Library...");
     foreach (string family in XilinxPartGen.LoadFamilyList())
     {
         Logger.Instance.WriteDebug("Loading Xilinx Part for the '{0}' family", family);
         Families.Add(XilinxPartGen.LoadFamily(this, family));
     }
 }
Esempio n. 6
0
 public void Add(Settler settler)
 {
     settler.Setup();
     Settlers.Add(settler);
     if (!Families.Contains(settler.Family))
     {
         Families.Add(settler.Family);
     }
 }
Esempio n. 7
0
 public void Add(Family family)
 {
     Families.Add(family);
     foreach (var member in family.Members)
     {
         member.Setup();
         Settlers.Add(member);
     }
 }
Esempio n. 8
0
        private void ProcessRootLevel(string[] lineArray)
        {
            switch (_currentRecord)
            {
            case GedcomRecordEnum.Individual:
                Individuals.Add(_currentIndividual);
                break;

            case GedcomRecordEnum.Family:
                Families.Add(_currentFamily);
                break;

            case GedcomRecordEnum.Note:
                Notes.Add(_currentNote);
                break;
            }

            if (lineArray[1] == "HEAD")
            {
                _currentRecord    = GedcomRecordEnum.Header;
                _currentSubRecord = GedcomSubRecordEnum.None;
            }
            else if (lineArray[1].IndexOf("@") >= 0)
            {
                switch (lineArray[2])
                {
                case "INDI":
                    _currentRecord     = GedcomRecordEnum.Individual;
                    _currentIndividual = new Individual {
                        Id = lineArray[1]
                    };
                    _currentSubRecord = GedcomSubRecordEnum.None;
                    break;

                case "FAM":
                    _currentRecord = GedcomRecordEnum.Family;
                    _currentFamily = new Family {
                        Id = lineArray[1]
                    };
                    _currentSubRecord = GedcomSubRecordEnum.None;
                    break;

                case "NOTE":
                    _currentRecord = GedcomRecordEnum.Note;
                    _currentNote   = new Note {
                        Id = lineArray[1]
                    };
                    _currentSubRecord = GedcomSubRecordEnum.None;
                    break;
                }
            }
        }
Esempio n. 9
0
        /// <summary>
        /// Method to invoke when the AddFamily command is executed.
        /// </summary>
        private async Task OnAddFamilyExecuteAsync()
        {
            var family = new Family();
            // Note that we use the type factory here because it will automatically take care of any dependencies
            // that the FamilyWindowViewModel will add in the future
            var typeFactory           = this.GetTypeFactory();
            var familyWindowViewModel = typeFactory.CreateInstanceWithParametersAndAutoCompletion <FamilyWindowViewModel>(family);

            if (await _uiVisualizerService.ShowDialogAsync(familyWindowViewModel) ?? false)
            {
                Families.Add(family);
            }
        }
Esempio n. 10
0
        /// <summary>
        /// Method to invoke when the AddFamily command is executed.
        /// Метод, который вызывается, когда команда AddFamily активирована.
        /// </summary>
        private async Task OnAddFamilyExecuteAsync()
        {
            var family = new Family();

            // Note that we use the type factory here because it will automatically take care of any dependencies
            // that the FamilyWindowViewModel will add in the future
            // Обратите внимание, что мы используем фабрику типов здесь,
            //потому что она автоматически позаботится о любых зависимостях,
            //которые FamilyWindowViewModel будет добавлять в будущем
            var typeFactory           = this.GetTypeFactory();
            var familyWindowViewModel = typeFactory.CreateInstanceWithParametersAndAutoCompletion <FamilyWindowViewModel>(family);

            if (await uiVisualizerService.ShowDialogAsync(familyWindowViewModel) ?? false)
            {
                Families.Add(family);

                UpdateSearchFilter();
            }
        }
Esempio n. 11
0
 public void AddFamily(string familyName)
 {
     Families.Add(familyName);
 }
Esempio n. 12
0
 public void AddFamily(Family family)
 {
     Families.Add(family);
     SaveChanges();
 }
Esempio n. 13
0
 public void AddFamily(Family family)
 {
     Families.Add(family);
     SaveFamilyToFile();
 }
Esempio n. 14
0
 public async Task <Family> AddFamily(Family family)
 {
     Families.Add(family);
     SaveChanges();
     return(family);
 }