Esempio n. 1
0
        public Window1()
        {
            InitializeComponent();

            List<VkGroupCategory> headCategories = new List<VkGroupCategory>();
            VkGroupCategory person1 = new VkGroupCategory() { Name = "Фото", isGroup = false };
            person1.IconSource = person1.GetIconSource();
            VkGroupCategory person2 = new VkGroupCategory() { Name = "Юмор", isGroup = false };
            person2.IconSource = person2.GetIconSource();
            VkGroup child1 = new VkGroup() { Name = "Лучший юмор", isGroup = true, groupId = 98013659 };
            child1.IconSource = child1.GetIconSource();
            person2.Children.Add(child1);

            VkGroup test = new VkGroup() { Name = "Лучшие фото", isGroup = true, groupId = 98738124 };
            test.IconSource = test.GetIconSource();
            person1.Children.Add(test);
            test = new VkGroup() { Name = "VkBoTest", isGroup = true, groupId = 97462940 };
            test.IconSource = test.GetIconSource();

            person1.Children.Add(test);

            headCategories.Add(person1);
            headCategories.Add(person2);

            person1.IsExpanded = true;
            person2.IsExpanded = true;

            categoriesTreeView.ItemsSource = headCategories;
            List<VkUser> userCategories = new List<VkUser>();
            VkUser user3 = new VkUser() { Name = "User3", email = "*****@*****.**", password = "******" };
            //VkUser user4 = new VkUser() { Name = "User4", email = "*****@*****.**", password = "******" };
            //VkUser user5 = new VkUser() { Name = "User5", email = "*****@*****.**", password = "******" };
            //VkUser user6 = new VkUser() { Name = "User6", email = "*****@*****.**", password = "******" };
            userCategories.Add(user3);
            //userCategories.Add(user4);
            //userCategories.Add(user5);
            //userCategories.Add(user6);
            usersTreeView.ItemsSource = userCategories;

                logger.Info("Application started");
        }
Esempio n. 2
0
        private void categoriesTreeView_Expanded(object sender, RoutedEventArgs e)
        {
            if (categoriesTreeView.SelectedItem is VkGroup)
            {
                VkGroup item = (VkGroup)categoriesTreeView.SelectedItem;
                currentlySelectedGroup = item;
                Group group = VkGroupManager.getInstance().getGroupById(item.groupId);
                nameLabel.Text = group.Name;
                statusLabel.Content = group.Status;
                Hyperlink link = new Hyperlink();
                link.NavigateUri = new Uri("http://vk.com/" + group.ScreenName);
                link.RequestNavigate += RequestNavigateEventHandler;

                link.Inlines.Add("vk.com/" + group.ScreenName);
                linkLabel.Inlines.Clear();
                linkLabel.Inlines.Add(link);
                image.Source = ByteToImage(group.photoBigSource);
                autoPostingCheckBox.IsChecked = item.autoPostingOn;
            }
            else
            {
                currentlySelectedGroup = null;
            }
        }