Пример #1
0
	protected void OnOpenUri (object o, OpenUriArgs args)
	{
		url = CheckUrl (args.AURI);
		// if the file is cached on disk, return
		if (url.StartsWith ("file:///") || url.StartsWith("javascript:", StringComparison.InvariantCultureIgnoreCase)) 
			return;
		
		if (UrlClicked != null)
			UrlClicked (this, new EventArgs());
		args.RetVal = true; //this prevents Gecko to continue processing
	}
Пример #2
0
		private void OnOpenUri (object o, OpenUriArgs args)
		{
			string uri = args.AURI;
			System.Console.WriteLine ("Open URI: {0}", uri);
			
			args.RetVal = true;

			if (DoAction (uri))
				return;

			if (uri.StartsWith ("action:")) {
				int pos1 = "action:".Length;
				int pos2 = uri.IndexOf ("!");
				if (pos2 > 0) {
					string tile_id = uri.Substring (pos1, pos2 - pos1);
					string action = uri.Substring (pos2 + 1);
					DispatchAction (tile_id, action);
				}
			}

			string command = null;
			string commandArgs = null;

			if (uri.StartsWith (Uri.UriSchemeHttp)
			    || uri.StartsWith (Uri.UriSchemeHttps)
			    || uri.StartsWith (Uri.UriSchemeFile)) {
				command = "gnome-open";
				commandArgs = "'" + uri + "'";
			} else if (uri.StartsWith (Uri.UriSchemeMailto)) {
				command = "evolution";
				commandArgs = uri;
			}

			if (command != null) {
				Process p = new Process ();
				p.StartInfo.UseShellExecute = false;
				p.StartInfo.FileName = command;
				if (args != null)
					p.StartInfo.Arguments = commandArgs;
				try {
					p.Start ();
				} catch (Exception e) {
					Console.WriteLine ("Unable to run {0}: {1}", command, e);
				}
				return;
			}

					
			return;
		}
Пример #3
0
        protected void OnOpenUri(object o, OpenUriArgs args)
        {
            url = CheckUrl(args.AURI);
            // if the file is cached on disk, return
            if (url.StartsWith("file:///") || url.StartsWith("javascript:", StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            if (UrlClicked != null)
            {
                UrlClicked(this, new EventArgs());
            }
            args.RetVal = true;     //this prevents Gecko to continue processing
        }
Пример #4
0
        private void OnOpenUri(object o, OpenUriArgs args)
        {
            string uri = args.AURI;

            System.Console.WriteLine("Open URI: {0}", uri);

            args.RetVal = true;

            if (DoAction(uri))
            {
                return;
            }

            if (uri.StartsWith("action:"))
            {
                int pos1 = "action:".Length;
                int pos2 = uri.IndexOf("!");
                if (pos2 > 0)
                {
                    string tile_id = uri.Substring(pos1, pos2 - pos1);
                    string action  = uri.Substring(pos2 + 1);
                    DispatchAction(tile_id, action);
                }
            }

            string command     = null;
            string commandArgs = null;

            if (uri.StartsWith(Uri.UriSchemeHttp) ||
                uri.StartsWith(Uri.UriSchemeHttps) ||
                uri.StartsWith(Uri.UriSchemeFile))
            {
                command     = "gnome-open";
                commandArgs = "'" + uri + "'";
            }
            else if (uri.StartsWith(Uri.UriSchemeMailto))
            {
                command     = "evolution";
                commandArgs = uri;
            }

            if (command != null)
            {
                Process p = new Process();
                p.StartInfo.UseShellExecute = false;
                p.StartInfo.FileName        = command;
                if (args != null)
                {
                    p.StartInfo.Arguments = commandArgs;
                }
                try {
                    p.Start();
                } catch (Exception e) {
                    Console.WriteLine("Unable to run {0}: {1}", command, e);
                }
                return;
            }


            return;
        }
Пример #5
0
    private void OnOpenUri(object o, OpenUriArgs args)
    {
        string uri = args.AURI;

        args.RetVal = true;

        if (uri.StartsWith ("item://")) {
            int itemPos = Int32.Parse (uri.Substring (7));

            ItemShelfElement element = (ItemShelfElement) elements[itemPos];
            presentation.Load (catalog.Table, element.Item);
            catalog.ItemCollection.UnselectAll ();
            element.Item.IsSelected = true;
            OnItemSelected (null, null);
        }
    }
    protected void OnOpenUri(object o, OpenUriArgs args )
    {
        //return false;

        //this.urlentry.AppendText(args.AURI);
        this.urlentry.InsertText(0,args.AURI);
        //this.urlentry.Active(0);
        //this.urlentry.ActiveText=args.AURI;
        Console.WriteLine(args.AURI);
        return;
    }