private void FillPersons()
        {
            var i = 1;

            foreach (var person in Persons)
            {
                try
                {
                    var persWindow = personWindows["person" + i++];
                    persWindow.personId                 = person.id;
                    persWindow.profileName.Content      = person.name;
                    persWindow.profileAge.Content       = person.birthDate == null ? "xxx" : person.birthDate.ToString();
                    persWindow.profileImage.Source      = new BitmapImage(new Uri(person.photoUrlMax.ToString()));
                    persWindow.profileFollowers.Content = "П: " + person.followers;
                    persWindow.profileInterests.Content = "И: " + person.interests;
                    persWindow.profileCicates.Content   = "Ц: " + person.Status;
                }
                catch (Exception e)
                {
                    addConsoleMsg(e.Message, true);
                }
            }

            foreach (KeyValuePair <string, PersonChat> kvp in personWindows)
            {
                PersonChat pc = kvp.Value;
                pc.wire(this);
            }
        }
Beispiel #2
0
        private void resizeItems()
        {
            //собираема
            List <PersonChat> allChats =
                GetVisualChilds <PersonChat>(mainCanvas as DependencyObject);
            int z = 1;

            foreach (PersonChat ch in allChats)
            {
                ch.personChatId = "person" + z;
                ch.profileChatNumber.Content = ch.personChatId;
                personWindows.Add(ch.Name, ch);
                z++;
            }

            int i      = 0;
            int j      = 0;
            int startX = -5;
            int startY = 0;

            int xSumm = 0;
            int ySumm = 0;
            int hh    = 0;

            foreach (KeyValuePair <string, PersonChat> kvp in personWindows)
            {
                PersonChat pc = kvp.Value;
                hh = pc.person_width + pc.person_width_margin;

                xSumm   = startX + i * (pc.person_width + pc.person_width_margin);
                ySumm   = startY + j * (pc.person_height + pc.person_height_margin);
                pc.left = xSumm;
                pc.top  = ySumm;
                pc.normalize();
                i++;

                if (i % 7 == 0)
                {
                    j++;
                    i = 0;
                }
                pc.wire(this);
            }
            //Canvas.SetLeft(console, xSumm + hh);
            //Canvas.SetTop(console, ySumm);
            //console.Width = hh - 5;
        }
Beispiel #3
0
        private void FillPersons()
        {
            var i = 1;

            foreach (var person in Persons)
            {
                try
                {
                    var persWindow = personWindows["person" + i++];
                    persWindow.personId                 = person.id;
                    persWindow.profileName.Content      = person.name;
                    persWindow.profileAge.Content       = person.birthDate == null ? "xxx" : person.birthDate.ToString();
                    persWindow.profileImage.Source      = new BitmapImage(new Uri(person.photoUrlMax.ToString()));
                    persWindow.profileFollowers.Content = "П: " + person.followers;
                    persWindow.profileInterests.Content = "И: " + person.interests;
                    persWindow.profileCicates.Content   = "Ц: " + person.Status;
                    //интересные для них
                    if (person.interests != null)
                    {
                        if (person.interests.Contains("кальян") || person.interests.Contains("дорам") ||
                            person.interests.Contains("аниме") ||
                            person.interests.Contains("дота") || person.interests.Contains("it") ||
                            person.interests.Contains("велоспорт"))
                        {
                            persWindow.profileName.Foreground = Brushes.Green;
                        }
                    }
                }
                catch (Exception e)
                {
                    addConsoleMsg(e.Message, true);
                }
            }

            foreach (KeyValuePair <string, PersonChat> kvp in personWindows)
            {
                PersonChat pc = kvp.Value;
                pc.wire(this);
            }
        }