private void OnTagClicked(object o, ItemActivatedArgs args) { TreePath childpath = _filter.ConvertPathToChildPath(args.Path); string tag = (string)_tags[childpath.Indices[0]]; ArrayList tagschosen; if (checkbutton1.Active || !checkbutton1.Sensitive) { Photo p = ((DeskFlickrUI.SelectedPhoto)_selectedphotos[_curphotoindex]).photo; p.AddTag(tag); tagschosen = p.Tags; } else { foreach (DeskFlickrUI.SelectedPhoto sel in _selectedphotos) { Photo p = sel.photo; p.AddTag(tag); } tagschosen = ((DeskFlickrUI.SelectedPhoto)_selectedphotos[0]).photo.Tags; foreach (DeskFlickrUI.SelectedPhoto sel in _selectedphotos) { Photo p = sel.photo; tagschosen = Utils.GetIntersection(tagschosen, p.Tags); } } ActivateRevertButton(); _ignorechangedevent = true; textview3.Buffer.Text = Utils.GetDelimitedString(tagschosen, " "); _ignorechangedevent = false; }
void OnItemActivated(object sender, ItemActivatedArgs a) { TreeIter iter; store.GetIter(out iter, a.Path); string path = (string)store.GetValue(iter, COL_PATH); bool isDir = (bool)store.GetValue(iter, COL_IS_DIRECTORY); if (!isDir) { OpenFile(path); return; } DirectoryInfo di = new DirectoryInfo(path); try { di.GetDirectories(); }catch { return; } parent = di; FillStore(true); if (parent.Parent == null) { upButton.Sensitive = false; } else { upButton.Sensitive = true; } }
protected void OnIV_SelectedServicesItemActivated(object o, ItemActivatedArgs a) { TreeIter iter; IV_SelectedServices.Model.GetIter(out iter, a.Path); List <Options> te = (List <Options>)(IV_SelectedServices.Model.GetValue(iter, 3)); string name = (string)(IV_SelectedServices.Model.GetValue(iter, 1)); if (name != "Свой сервис") { new OptionsWindow(name, te); } else { int currNumb = -1; TreeIter iterTemp; SelectedServices.GetIterFirst(out iterTemp); while (SelectedServices.IterNext(ref iterTemp)) { string serviceName = ((List <Options>)SelectedServices.GetValue(iterTemp, 3))[0].Value; if (serviceName.Contains("Свой сервис ")) { int numb = Convert.ToInt32(serviceName.Split(' ')[2]); if (currNumb <= numb) { currNumb = numb; } } } AddToSelectedServices("Свой сервис " + ++currNumb, DefaultServiceIcon); } }
// Show when item is entered private void List_ItemActivated(object sender, ItemActivatedArgs args) { movieinfo = new YahooTrailersInfo(); movieinfo.Title = ((YahooTrailersListItem)_trailerlist.SelectedItem).Title.Text; movieinfo.Details = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._details); movieinfo.Starring = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._starring); movieinfo.Genre = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._genre); movieinfo.ReleaseDate = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._releasedate); movieinfo.Rating = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._rating); movieinfo.JPEGURL = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._jpegURL); if (((YahooTrailersListItem)_trailerlist.SelectedItem)._trailer2URL != null) { movieinfo._trailer2URL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailer2URL; } if (((YahooTrailersListItem)_trailerlist.SelectedItem)._trailerURL != null) { movieinfo._trailerURL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailerURL; } if (((YahooTrailersListItem)_trailerlist.SelectedItem)._teaser2URL != null) { movieinfo._teaser2URL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaser2URL; } if (((YahooTrailersListItem)_trailerlist.SelectedItem)._teaserURL != null) { movieinfo._teaserURL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaserURL; } ShowScreen s = new ShowScreen("YahooTrailersDetailsScreen", movieinfo); s.Execute(); return; }
protected void OnItemActivated(object sender, ItemActivatedArgs args) { // Get File Path & IsDirectory Flag bool isDir = store.GetIsDirectory(args.Path); string path = store.GetFilePath(args.Path); if (isDir == true) { // Replace Parent With Path and ReFill The Model currentDirectory = new DirectoryInfo(path); // Refresh FileStore Gtk.Application.Invoke(delegate { Refresh(); }); // Sensitize the up button if (DirChanged != null) { DirChanged(this, true); } } else if (userInfo == MyInfo.GetInstance()) { try { // Try To Open This File System.Diagnostics.Process.Start(path); } catch (Exception e) { Debug.Log("Failed Process.Start() {0}: {1}", path, e.Message); } } }
// Show slideshow when item is entered private void List_ItemActivated(object sender, ItemActivatedArgs args) { string artist = ((iTunesListItem)_list.SelectedItem).Artist.Text; string song = ((iTunesListItem)_list.SelectedItem).Song.Text; //iTunesPlay(channel,artist,song); return; }
// Change channel private void XMChannels_ItemActivated(object sender, ItemActivatedArgs args) { string channel = ((XMListItem)_xmChannels.SelectedItem).Channel.Text; string artist = ((XMListItem)_xmChannels.SelectedItem).Artist.Text; string song = ((XMListItem)_xmChannels.SelectedItem).Song.Text; string album = ((XMListItem)_xmChannels.SelectedItem).Album.Text; XMplay(channel, artist, song, album); currentChannel = int.Parse(channel); return; }
private void OnItemActivated(object sender, ItemActivatedArgs args) { if (_options.SelectedItem.Text.StartsWith("Search")) { HideAll(); _search.Visible = true; _searchEntry.Visible = true; _searchEntry.Focus(); } return; }
//Service selection from all protected void OnIV_AllServicesItemActivated(object o, ItemActivatedArgs a) { TreeIter iter; IV_AllServices.FreezeChildNotify(); IV_AllServices.Model.GetIter(out iter, a.Path); AddToSelectedServices(IV_AllServices.Model.GetValue(iter, 1).ToString(), (Pixbuf)(IV_AllServices.Model.GetValue(iter, 2))); IV_AllServices.ThawChildNotify(); AllServices.Remove(ref iter); OnSearchSChanged(new object(), new EventArgs()); }
public void OnRecentFileIconActivated(object o, ItemActivatedArgs e) { TreeIter iter; if (recentFileList.GetIter(out iter, e.Path)) { EventHandler OnClick = (EventHandler)recentFileList.GetValue(iter, 3); if (OnClick != null) { OnClick(this, e); } } }
protected void OnItemActivated(object sender, ItemActivatedArgs args) { UserInfo userInfo = store.GetUserInfo(args.Path); if (userInfo == null) { return; } if (ItemActivated != null) { ItemActivated(this, userInfo); } }
private void lbDefaultNames_Click(object sender, ItemActivatedArgs e) { if (SupplementAdded != null && e.Path.Indices[0] > 0) { TreeIter iter; if (defNameList.GetIter(out iter, e.Path)) { TStringArgs args = new TStringArgs(); args.name = (string)defNameList.GetValue(iter, 0); SupplementAdded.Invoke(sender, args); } } lbDefaultNames.Visible = false; }
// Click the checkbox to subscribe or unsubscribe private void OnItemActivated(object sender, ItemActivatedArgs args) { CheckBoxListItem item = _availableComics.Items[args.ActivatedIndex] as CheckBoxListItem; if (item == null) { return; } item.CheckBox.Checked = !item.CheckBox.Checked; ComicInfo ci = (ComicInfo)item.Value; SingletonComicsUpdater.Instance.Subscribe(ci.DisplayName, item.CheckBox.Checked); return; }
private void OnItemActivated(object sender, ItemActivatedArgs args) { if (_options.SelectedItem.Text.StartsWith("URL")) { HideAll(); _url.Visible = true; _urlEntry.Visible = true; _urlEntry.Focus(); } else if (_options.SelectedItem.Text.StartsWith("Password")) { HideAll(); _password.Visible = true; _passwordEntry.Visible = true; _passwordEntry.Focus(); } return; }
void HandleItemActivated(object o, ItemActivatedArgs args) { TreeIter iter; ProjectDescription pdesc; if (swallowSignals) { return; } if (ProjectSelected != null) { iconview.Model.GetIter(out iter, args.Path); pdesc = iconview.Model.GetValue(iter, COL_PROJECT_DESCRIPTION) as ProjectDescription; if (pdesc != null) { ProjectSelected(pdesc); } } }
void OnItemActivated(object sender, ItemActivatedArgs a) { TreeIter iter; store.GetIter(out iter, a.Path); string path = (string)store.GetValue(iter, COL_PATH); bool isDir = (bool)store.GetValue(iter, COL_IS_DIRECTORY); if (!isDir) { return; } // Replace parent with path and re-fill the model parent = new DirectoryInfo(path); FillStore(); // Sensitize the up button upButton.Sensitive = true; }
void HandleItemActivated(object o, ItemActivatedArgs args) { TreeIter iter; LMProject project; if (swallowSignals) { return; } if (ProjectSelected != null) { iconview.Model.GetIter(out iter, args.Path); project = iconview.Model.GetValue(iter, COL_PROJECT) as LMProject; if (project != null) { ProjectSelected(project); } } }
protected void OnItemActivated(object sender, ItemActivatedArgs args) { // Get File Path & IsDirectory Flag bool isDir = store.GetIsDirectory(args.Path); string path = store.GetFilePath(args.Path); if (isDir == true) { // Replace Parent With Path and ReFill The Model currentDirectory = new DirectoryInfo(path); // Refresh FileStore Gtk.Application.Invoke(delegate { Refresh(); }); // Sensitize the up button if (DirChanged != null) { DirChanged(this, true); } } }
// Show slideshow when item is entered private void ComicsViewer_ItemActivated(object sender, ItemActivatedArgs args) { if (((ComicListItem)(_comicsViewer.SelectedItem)).Caption.Text == "Downloading Comics... Click to refresh") { Fillcomics(); return; } ArrayList aComics; aComics = new ArrayList(); foreach (ComicListItem item in _comicsViewer.Items) { aComics.Add(item.FullName); } string[] comics = (string[])aComics.ToArray(typeof(string)); double zoom; try { string sZoom; SingletonConfig.Instance.GetPropertyAsString("Comics.DefaultZoom", out sZoom); zoom = double.Parse(sZoom); zoom /= 100; } catch { zoom = 1.5; } ShowScreen s = new ShowScreen("ComicsSlideShowScreen", new object[] { comics, _comicsViewer.SelectedIndex, false, zoom, true }); s.Execute(); return; }
private void LbDefaultNames_Click(object sender, ItemActivatedArgs e) { try { if (SupplementAdded != null && e.Path.Indices[0] > 0) { TreeIter iter; if (defNameList.GetIter(out iter, e.Path)) { TStringArgs args = new TStringArgs(); args.Name = (string)defNameList.GetValue(iter, 0); if (SupplementAdded != null) { SupplementAdded.Invoke(sender, args); } } } lblDefaultNames.Visible = false; } catch (Exception err) { ShowError(err); } }
// Select new Genre and go to the first index in the list private void _xmGenres_ItemActivated(object sender, ItemActivatedArgs args) { switch (args.ActivatedIndex) { case 0: // Decades _xmChannels.SelectedIndex = 0; break; case 1: // Country _xmChannels.SelectedIndex = 6; break; case 2: // Pop _xmChannels.SelectedIndex = 15; break; case 3: // Christian _xmChannels.SelectedIndex = 24; break; case 4: // Rock _xmChannels.SelectedIndex = 29; break; case 5: // Hip Hop _xmChannels.SelectedIndex = 49; break; case 6: // Jazz _xmChannels.SelectedIndex = 56; break; case 7: // Classical _xmChannels.SelectedIndex = 63; break; case 8: // Dance _xmChannels.SelectedIndex = 66; break; case 9: // Latin and World _xmChannels.SelectedIndex = 71; break; case 10: // Best of Sirius _xmChannels.SelectedIndex = 79; break; case 11: // Kids _xmChannels.SelectedIndex = 82; break; case 12: // News _xmChannels.SelectedIndex = 87; break; case 13: // Sports _xmChannels.SelectedIndex = 97; break; case 14: // Comedy _xmChannels.SelectedIndex = 100; break; case 15: // Talk _xmChannels.SelectedIndex = 104; break; default: break; } }
protected void OnIconviewFilesItemActivated(object o, ItemActivatedArgs args) { buttonOpen.Click(); }
private void OnItemActivated( object sender, ItemActivatedArgs args ) { if( _options.SelectedItem.Text.StartsWith("Search") ) { HideAll(); _search.Visible = true; _searchEntry.Visible = true; _searchEntry.Focus(); } return; }
// Click the checkbox to subscribe or unsubscribe private void OnItemActivated( object sender, ItemActivatedArgs args ) { CheckBoxListItem item = _availableComics.Items[ args.ActivatedIndex ] as CheckBoxListItem; if( item == null ) { return; } item.CheckBox.Checked = !item.CheckBox.Checked; ComicInfo ci = (ComicInfo)item.Value; SingletonComicsUpdater.Instance.Subscribe( ci.DisplayName, item.CheckBox.Checked ); return; }
void OnItemActivated(object sender, ItemActivatedArgs a) { TreeIter iter; view.Model.GetIter (out iter, a.Path); ChessGame details = (ChessGame) view.Model.GetValue (iter, 0); FireGameSelectionEvent (details); }
// Other void OnItemActivated(object sender, ItemActivatedArgs e) { OnPlayClicked(sender, e); }
// Tune to favorite private void _xmFavs_ItemActivated(object sender, ItemActivatedArgs args) { _xmChannels.SelectedIndex = int.Parse(favorites[_xmFavs.SelectedIndex]); string channel = ((XMListItem)_xmChannels.SelectedItem).Channel.Text; string artist = ((XMListItem)_xmChannels.SelectedItem).Artist.Text; string song = ((XMListItem)_xmChannels.SelectedItem).Song.Text; string album = ((XMListItem)_xmChannels.SelectedItem).Album.Text; XMplay(channel,artist,song,album); currentChannel = int.Parse(channel); return; }
// Select new Genre and go to the first index in the list private void _xmGenres_ItemActivated(object sender, ItemActivatedArgs args) { switch (args.ActivatedIndex) { case 0: // Decades _xmChannels.SelectedIndex = 0; break; case 1: // Country _xmChannels.SelectedIndex = 6; break; case 2: // Pop _xmChannels.SelectedIndex = 15; break; case 3: // Christian _xmChannels.SelectedIndex = 24; break; case 4: // Rock _xmChannels.SelectedIndex = 29; break; case 5: // Hip Hop _xmChannels.SelectedIndex = 49; break; case 6: // Jazz _xmChannels.SelectedIndex = 56; break; case 7: // Classical _xmChannels.SelectedIndex = 63; break; case 8: // Dance _xmChannels.SelectedIndex = 66; break; case 9: // Latin and World _xmChannels.SelectedIndex = 71; break; case 10: // Best of Sirius _xmChannels.SelectedIndex = 79; break; case 11: // Kids _xmChannels.SelectedIndex = 82; break; case 12: // News _xmChannels.SelectedIndex = 87; break; case 13: // Sports _xmChannels.SelectedIndex = 97; break; case 14: // Comedy _xmChannels.SelectedIndex = 100; break; case 15: // Talk _xmChannels.SelectedIndex = 104; break; default: break; } }
protected override bool OnButtonPressEvent(Gdk.EventButton ev) { base.OnButtonPressEvent(ev); if (ev.Button != 1) { return(false); } if (model == null) { return(false); } if (!HasFocus) { GrabFocus(); } // adjust to total canvas coordinates int x = (int)(ev.X + hadj.Value); int y = (int)(ev.Y + vadj.Value); if (x <= padding || y <= padding) { return(false); } if (cell_size == Gdk.Rectangle.Zero) { // we must be empty, or not have been size // requested yet return(false); } int r, c; bool hit; hit = GetRowAndColAtCoords(x, y, out r, out c); TreePath path; if (!hit || !GetPathAtRowAndCol(r, c, out path)) { if (selection_mode == SelectionMode.Multiple) { // Rubberbanding sel_start.X = x; sel_start.Y = y; sel_rect.X = sel_start.X; sel_rect.Y = sel_start.Y; sel_rect.Width = sel_rect.Height = 0; have_rubberband_selection = true; // Save a copy of the selected_paths so // we know what we started with when we // start rubberbanding pre_rubberbanded_selection = (ArrayList)selected_paths.Clone(); return(true); } if ((ev.State & Gdk.ModifierType.ControlMask) > 0) { // If we have control pressed down, // don't punish the user by killing // their selection return(false); } UnselectAll(); return(false); } if (selection_mode == SelectionMode.Multiple && (ev.State & Gdk.ModifierType.ShiftMask) > 0) { if (selection_anchor == null) { selection_anchor = path; } else { UnselectAll(); SelectAllBetween(selection_anchor, path); return(true); } } else { // do we need to deselect? if ((ev.State & Gdk.ModifierType.ControlMask) > 0 && (selection_mode == SelectionMode.Multiple || selection_mode == SelectionMode.Single)) { if (selected_paths.Contains(path)) { UnselectPath(path); return(true); } } } if (selection_mode == SelectionMode.Multiple && !selected_paths.Contains(path) && (ev.State & Gdk.ModifierType.ControlMask) == 0) { UnselectAll(); } if (ev.Type == Gdk.EventType.TwoButtonPress && ItemActivated != null) { ItemActivatedArgs activated_args = new ItemActivatedArgs(); activated_args.Args = new object[] { path }; ItemActivated(this, activated_args); } // SelectPath will handle multiple selection vs browse // vs single for us SelectPath(path); return(true); }
protected override bool OnKeyPressEvent(Gdk.EventKey ev) { if (model == null) { return(false); } int r, c; TreePath tmp; // Lame workaround for GtkBinding not being bound switch (ev.Key) { // Activate keycodes case Gdk.Key.space: case Gdk.Key.Return: case Gdk.Key.ISO_Enter: case Gdk.Key.KP_Enter: // Remove this when we can use OnActivate () if (focused_path == null) { return(false); } if ((ev.State & Gdk.ModifierType.ControlMask) == 0) { UnselectAll(); } if (selected_paths.Contains(focused_path)) { UnselectPath(focused_path); } else { SelectPath(focused_path); } if (ItemActivated != null) { ItemActivatedArgs activated_args = new ItemActivatedArgs(); activated_args.Args = new object[] { focused_path }; ItemActivated(this, activated_args); } return(true); case Gdk.Key.a: // if control down, select all if (selection_mode == SelectionMode.Multiple && (ev.State & Gdk.ModifierType.ControlMask) > 0) { SelectAll(); } return(true); case Gdk.Key.A: // if control down and shift down, unselect all if (selection_mode == SelectionMode.Multiple && (ev.State & Gdk.ModifierType.ControlMask) > 0 && (ev.State & Gdk.ModifierType.ShiftMask) > 0) { UnselectAll(); } return(true); case Gdk.Key.Up: case Gdk.Key.KP_Up: // Move focus or selection up if (layout_mode == LayoutMode.Vertical || layout_mode == LayoutMode.Grid) { // find out the currently focused r and c GetRowAndColForPath(focused_path, out r, out c); // decrement the row by 1 if (r > 0) { r--; // find the path at new r, c if (GetPathAtRowAndCol(r, c, out tmp)) { focused_path = tmp; } } } break; case Gdk.Key.Down: case Gdk.Key.KP_Down: // move down if (layout_mode == LayoutMode.Vertical || layout_mode == LayoutMode.Grid) { // find out the currently focused r and c GetRowAndColForPath(focused_path, out r, out c); // increment the row by 1 r++; // find the path at new r, c if (GetPathAtRowAndCol(r, c, out tmp)) { focused_path = tmp; } } break; case Gdk.Key.Left: case Gdk.Key.KP_Left: // move left if (layout_mode == LayoutMode.Horizontal || layout_mode == LayoutMode.Grid) { tmp = focused_path.Copy(); // don't wrap around if (tmp.Prev()) { focused_path = tmp; } } break; case Gdk.Key.Right: case Gdk.Key.KP_Right: // move right if (layout_mode == LayoutMode.Horizontal || layout_mode == LayoutMode.Grid) { tmp = focused_path.Copy(); tmp.Next(); if (PathIsValid(tmp)) { focused_path = tmp; } } break; case Gdk.Key.Home: case Gdk.Key.KP_Home: // select and focus the first item, dropping // current selection tmp = TreePath.NewFirst(); // verify that the path is valid if (PathIsValid(tmp)) { selected_paths.Clear(); focused_path = tmp; SelectPath(focused_path); } return(true); case Gdk.Key.End: case Gdk.Key.KP_End: // select and focus the first item, dropping // current selection tmp = new TreePath(new int[] { n_cells - 1 }); // verify that the path is valid if (PathIsValid(tmp)) { selected_paths.Clear(); focused_path = tmp; SelectPath(focused_path); } return(true); } if (selection_mode == SelectionMode.Multiple && (ev.State & Gdk.ModifierType.ShiftMask) > 0) { selected_paths.Clear(); SelectAllBetween(selection_anchor, focused_path); return(true); } if (selection_mode == SelectionMode.Browse) { SelectPath(focused_path); } else { // TODO: Constrain this to only the previous focus and QueueDraw(); } return(true); }
/// <summary> /// Maneja el evento de activación (doble click) de un icono. /// </summary> private void OnFilesIconViewItemActivated(object o, ItemActivatedArgs a) { FilesIconViewItemActivated(); }
// Show slideshow when item is entered private void List_ItemActivated( object sender, ItemActivatedArgs args ) { string artist = ((iTunesListItem)_list.SelectedItem).Artist.Text; string song = ((iTunesListItem)_list.SelectedItem).Song.Text; //iTunesPlay(channel,artist,song); return; }
// Show slideshow when item is entered private void ComicsViewer_ItemActivated( object sender, ItemActivatedArgs args ) { if (((ComicListItem)(_comicsViewer.SelectedItem)).Caption.Text == "Downloading Comics... Click to refresh") { Fillcomics(); return; } ArrayList aComics; aComics = new ArrayList(); foreach( ComicListItem item in _comicsViewer.Items ) { aComics.Add( item.FullName ); } string[] comics = (string[])aComics.ToArray( typeof(string) ); double zoom; try { string sZoom; SingletonConfig.Instance.GetPropertyAsString( "Comics.DefaultZoom", out sZoom ); zoom = double.Parse( sZoom ); zoom /= 100; } catch { zoom = 1.5; } ShowScreen s = new ShowScreen( "ComicsSlideShowScreen", new object[] { comics, _comicsViewer.SelectedIndex, false, zoom, true } ); s.Execute(); return; }
// Play selected trailer private void List_ItemActivated(object sender, ItemActivatedArgs args) { string movieURL = ((Trailer)_trailers.SelectedItem)._movieURL.Replace("&", "&"); SnapStream.Logging.WriteLog(movieURL); movURL = null; // Create a webclient try { // Get the trailer qtl file HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(new System.Uri(movieURL)); webreq.Referer = "http://movies.yahoo.com/"; webreq.AllowAutoRedirect = false; HttpWebResponse webres = (HttpWebResponse)webreq.GetResponse(); Stream resStream = webres.GetResponseStream(); string response = new StreamReader(resStream).ReadToEnd(); //SnapStream.Logging.WriteLog("Movie URL Response: " + response); int startindex = response.IndexOf("HREF=\"") + 6; int endindex = response.IndexOf("\">", startindex); string qtlURL = response.Substring(startindex, endindex - startindex).Trim(); //SnapStream.Logging.WriteLog("QTL URL: " + qtlURL); // Get the sid in the qtl file webreq = (HttpWebRequest)WebRequest.Create(new System.Uri(qtlURL.Replace("&", "&"))); webreq.AllowAutoRedirect = true; // was false webreq.Referer = "http://movies.yahoo.com/"; webres = (HttpWebResponse)webreq.GetResponse(); resStream = webres.GetResponseStream(); response = new StreamReader(resStream).ReadToEnd(); //SnapStream.Logging.WriteLog("QTL URL Response: " + response); startindex = response.IndexOf("sid=") + 4; endindex = response.IndexOf("&t", startindex); movURL = "http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=" + response.Substring(startindex, endindex - startindex).Trim(); //SnapStream.Logging.WriteLog("MOV URL: " + movURL); webreq = (HttpWebRequest)WebRequest.Create(new System.Uri(movURL.Replace("&", "&"))); webreq.AllowAutoRedirect = false; // was false webres = (HttpWebResponse)webreq.GetResponse(); resStream = webres.GetResponseStream(); response = new StreamReader(resStream).ReadToEnd(); //SnapStream.Logging.WriteLog("QTL URL Response: " + response); // Create local movie file path movTitle = _header.Text + "_" + ((Trailer)_trailers.SelectedItem).Title; movLocalFile = movTitle + ".mov"; movLocalFile = movLocalFile.Replace(":", "").Replace("?", ""); movLocalPath = homedir + "\\Trailers\\" + movLocalFile; //SnapStream.Logging.WriteLog(movLocalFile); // Download or Play trailer if (((Trailer)_trailers.SelectedItem).Title.StartsWith("PLAY")) { movLocalPath = movLocalPath.Replace("PLAY ", ""); //SnapStream.Logging.WriteLog("Playing: " + movLocalPath); ShowScreen s = new ShowScreen("VideoPlayerScreen", movLocalPath); s.Execute(); } else { //SnapStream.Logging.WriteLog("Downloading"); //dlThread = new Thread(new ThreadStart(download)); //dlThread.Start(); SingletonDownloader.Instance.movLocalPath = movLocalPath; SingletonDownloader.Instance.movURL = movURL; SingletonDownloader.Instance.Download(); ((Trailer)_trailers.SelectedItem).ChangeControl("PLAY"); //SnapStream.Logging.WriteLog(SingletonDownloader.Instance.isDownloading.ToString()); } } catch (Exception exp) { string str = exp.Message; } }
//Doubleclick private void OnItemActivated(object sender, ItemActivatedArgs a) { OnInstallButtonClicked(sender, a); }
private void avatarIconView_ItemActivated(object o, ItemActivatedArgs args) { okButton_clicked(null, null); }
// Play selected trailer private void List_ItemActivated( object sender, ItemActivatedArgs args ) { string movieURL = ((Trailer)_trailers.SelectedItem)._movieURL.Replace("&","&"); SnapStream.Logging.WriteLog(movieURL); movURL = null; // Create a webclient try { // Get the trailer qtl file HttpWebRequest webreq = (HttpWebRequest)WebRequest.Create(new System.Uri(movieURL)); webreq.Referer = "http://movies.yahoo.com/"; webreq.AllowAutoRedirect = false; HttpWebResponse webres = (HttpWebResponse)webreq.GetResponse(); Stream resStream = webres.GetResponseStream(); string response = new StreamReader( resStream ).ReadToEnd(); //SnapStream.Logging.WriteLog("Movie URL Response: " + response); int startindex = response.IndexOf("HREF=\"")+6; int endindex = response.IndexOf("\">",startindex); string qtlURL = response.Substring(startindex,endindex-startindex).Trim(); //SnapStream.Logging.WriteLog("QTL URL: " + qtlURL); // Get the sid in the qtl file webreq = (HttpWebRequest)WebRequest.Create(new System.Uri(qtlURL.Replace("&","&"))); webreq.AllowAutoRedirect = true; // was false webreq.Referer = "http://movies.yahoo.com/"; webres = (HttpWebResponse)webreq.GetResponse(); resStream = webres.GetResponseStream(); response = new StreamReader( resStream ).ReadToEnd(); //SnapStream.Logging.WriteLog("QTL URL Response: " + response); startindex = response.IndexOf("sid=")+4; endindex = response.IndexOf("&t",startindex); movURL = "http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=" + response.Substring(startindex,endindex-startindex).Trim(); //SnapStream.Logging.WriteLog("MOV URL: " + movURL); webreq = (HttpWebRequest)WebRequest.Create(new System.Uri(movURL.Replace("&","&"))); webreq.AllowAutoRedirect = false; // was false webres = (HttpWebResponse)webreq.GetResponse(); resStream = webres.GetResponseStream(); response = new StreamReader( resStream ).ReadToEnd(); //SnapStream.Logging.WriteLog("QTL URL Response: " + response); // Create local movie file path movTitle = _header.Text + "_" + ((Trailer)_trailers.SelectedItem).Title; movLocalFile = movTitle + ".mov"; movLocalFile = movLocalFile.Replace(":","").Replace("?",""); movLocalPath = homedir + "\\Trailers\\" + movLocalFile; //SnapStream.Logging.WriteLog(movLocalFile); // Download or Play trailer if (((Trailer)_trailers.SelectedItem).Title.StartsWith("PLAY")) { movLocalPath = movLocalPath.Replace("PLAY ",""); //SnapStream.Logging.WriteLog("Playing: " + movLocalPath); ShowScreen s = new ShowScreen("VideoPlayerScreen", movLocalPath); s.Execute(); } else { //SnapStream.Logging.WriteLog("Downloading"); //dlThread = new Thread(new ThreadStart(download)); //dlThread.Start(); SingletonDownloader.Instance.movLocalPath = movLocalPath; SingletonDownloader.Instance.movURL = movURL; SingletonDownloader.Instance.Download(); ((Trailer)_trailers.SelectedItem).ChangeControl("PLAY"); //SnapStream.Logging.WriteLog(SingletonDownloader.Instance.isDownloading.ToString()); } } catch(Exception exp) { string str = exp.Message; } }
private void OnItemActivated( object sender, ItemActivatedArgs args ) { if( _options.SelectedItem.Text.StartsWith("Email") ) { HideAll(); _email.Visible = true; _emailEntry.Visible = true; _emailEntry.Focus(); } else if( _options.SelectedItem.Text.StartsWith("Password") ) { HideAll(); _password.Visible = true; _passwordEntry.Visible = true; _passwordEntry.Focus(); } return; }
// Show when item is entered private void List_ItemActivated( object sender, ItemActivatedArgs args ) { movieinfo = new YahooTrailersInfo(); movieinfo.Title = ((YahooTrailersListItem)_trailerlist.SelectedItem).Title.Text; movieinfo.Details = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._details); movieinfo.Starring = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._starring); movieinfo.Genre = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._genre); movieinfo.ReleaseDate = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._releasedate); movieinfo.Rating = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._rating); movieinfo.JPEGURL = replaceSpecials(((YahooTrailersListItem)_trailerlist.SelectedItem)._jpegURL); if ( ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailer2URL != null ) movieinfo._trailer2URL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailer2URL; if ( ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailerURL != null ) movieinfo._trailerURL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._trailerURL; if ( ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaser2URL != null ) movieinfo._teaser2URL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaser2URL; if ( ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaserURL != null ) movieinfo._teaserURL = ((YahooTrailersListItem)_trailerlist.SelectedItem)._teaserURL; ShowScreen s = new ShowScreen( "YahooTrailersDetailsScreen", movieinfo ); s.Execute(); return; }