private void ShowProfile() { StatusItem selectedItem = statList.SelectedItem as StatusItem; if (selectedItem == null) { return; } ChangeCursor(Cursors.WaitCursor); IProfileViewer view; if (DetectDevice.DeviceType == DeviceType.Professional) { view = new ProfileView(selectedItem.Tweet.user); } else { view = new ProfileViewSmartPhone(selectedItem.Tweet.user); } ChangeCursor(Cursors.Default); IsLoaded = false; statList.Visible = false; ((Form)view).Owner = this; ((Form)view).ShowDialog(); this.Visible = true; statList.Visible = true; IsLoaded = true; //statList.OpenLeftMenu(); //statList.RightMenu.SelectedItem = null; //statList.LeftMenu.SelectedItem = null; ((Form)view).Close(); if (String.IsNullOrEmpty(view.selectedUser)) { return; } statList.IgnoreMouse = true; if (view.selectedAction == ProfileAction.UserTimeline) { SwitchToUserTimeLine(view.selectedUser); } else if (view.selectedAction == ProfileAction.Favorites) { SwitchToUserFavorites(view.selectedUser); } else if (view.selectedAction == ProfileAction.Followers) { //TODO } else if (view.selectedAction == ProfileAction.Following) { //TODO } else { statList.IgnoreMouse = false; //is this needed? } ((Form)view).Dispose(); }
private void ShowProfile() { if (statList.SelectedItem == null) { return; } StatusItem selectedItem = (StatusItem)statList.SelectedItem; using (ProfileView v = new ProfileView(selectedItem.Tweet.user)) { v.ShowDialog(); } }