public void UpdateStories() { var insta = proxy.GetFeed(NombreUsuario.Text); StoryPanel.Controls.Clear(); y2 = 10; if (insta.stories.stories.Count > 0) { var Mystory = new ConstructorStories(StoryPanel, 0, y2, StorieUsuario, insta.stories, name, UpdateStories).CrearObjeto(); Mystory.crearPanel(); StoryPanel.Controls.Add(Mystory.obtenerPanel()); y2 += StoryPanel.Height / 6 + 10; } foreach (Stories item in insta.publicStories) { var story = new ConstructorStories(StoryPanel, 0, y2, StorieUsuario, item, name, UpdateStories).CrearObjeto(); story.crearPanel(); StoryPanel.Controls.Add(story.obtenerPanel()); y2 += StoryPanel.Height / 6 + 10; } StoryPanel.Focus(); }
public Inicio(string data) { string url = Directory.GetCurrentDirectory(); for (int i = 0; i < url.Length - 9; i++) { newURL += url[i]; } proxy = new ProxyInstagram(); var res = proxy.GetUser(data); name = res.user; // DB User InitializeComponent(); TopPanel.SendToBack(); button2.FlatAppearance.BorderSize = 0; button3.FlatAppearance.BorderSize = 0; button4.FlatAppearance.BorderSize = 0; ConfigPanel.Visible = false; PostsPanel.AutoScroll = true; StoryPanel.AutoScroll = true; this.ActiveControl = PostsPanel; BPanel.BringToFront(); BPanel.AutoScroll = true; BPanel.Visible = false; BPanel.BorderStyle = BorderStyle.FixedSingle; this.Controls.Add(BPanel); ConfigPanel.BorderStyle = BorderStyle.FixedSingle; NombreUsuario.Text = res.user; NombreCompleto.Text = res.nombre; var urlimage = newURL + res.foto; Image image = Image.FromFile(urlimage); ImagenPerfil.Image = image; ImagenPerfil.Width = 44; ImagenPerfil.Height = 44; //Cargar Feed DB var insta = proxy.GetFeed(res.user); foreach (Post item in insta.publico) { var post = new ConstructorPosts(PostsPanel, 0, y, PerfilUsuario, item, name, UpdatePosts, this).CrearObjeto(); post.crearPanel(); PostsPanel.Controls.Add(post.obtenerPanel()); y += post.obtenerPanel().Height + 20; } // My Stories if (insta.stories.stories.Count > 0) { var Mystory = new ConstructorStories(StoryPanel, 0, y2, StorieUsuario, insta.stories, res.user, UpdateStories).CrearObjeto(); Mystory.crearPanel(); StoryPanel.Controls.Add(Mystory.obtenerPanel()); y2 += StoryPanel.Height / 6 + 10; } // foreach (Stories item in insta.publicStories) { var story = new ConstructorStories(StoryPanel, 0, y2, StorieUsuario, item, res.user, UpdateStories).CrearObjeto(); story.crearPanel(); StoryPanel.Controls.Add(story.obtenerPanel()); y2 += StoryPanel.Height / 6 + 10; } }