Example #1
0
        public static void DispatchLink(string uri)
        {
            try {
                if (uri.StartsWith("project://"))
                {
                    string           file        = uri.Substring("project://".Length);
                    Gdk.ModifierType mtype       = GtkWorkarounds.GetCurrentKeyModifiers();
                    bool             inWorkspace = (mtype & Gdk.ModifierType.ControlMask) != 0;

                    // Notify the RecentFiles that this item does not exist anymore.
                    // Possible other solution would be to check the recent projects list on focus in
                    // and update them accordingly.
                    if (!System.IO.File.Exists(file))
                    {
                        MessageService.ShowError(GettextCatalog.GetString("File not found {0}", file));
                        FileService.NotifyFileRemoved(file);
                        return;
                    }

                    IdeApp.Workspace.OpenWorkspaceItem(file, !inWorkspace);
                }
                else if (uri.StartsWith("monodevelop://"))
                {
                    var cmdId = uri.Substring("monodevelop://".Length);
                    IdeApp.CommandService.DispatchCommand(cmdId, MonoDevelop.Components.Commands.CommandSource.WelcomePage);
                }
                else
                {
                    DesktopService.ShowUrl(uri);
                }
            } catch (Exception ex) {
                LoggingService.LogInternalError(GettextCatalog.GetString("Could not open the url '{0}'", uri), ex);
            }
        }
Example #2
0
        protected override void Run(object dataItem)
        {
            string filename = (string)dataItem;

            Gdk.ModifierType mtype       = GtkWorkarounds.GetCurrentKeyModifiers();
            bool             inWorkspace = (mtype & Gdk.ModifierType.ControlMask) != 0;

            IdeApp.Workspace.OpenWorkspaceItem(filename, !inWorkspace);
        }
Example #3
0
        public static void DispatchLink(string uri)
        {
            try {
                if (uri.StartsWith("project://"))
                {
                    string           file        = uri.Substring("project://".Length);
                    Gdk.ModifierType mtype       = GtkWorkarounds.GetCurrentKeyModifiers();
                    bool             inWorkspace = (mtype & Gdk.ModifierType.ControlMask) != 0;
                    if (Platform.IsMac && !inWorkspace)
                    {
                        inWorkspace = (mtype & Gdk.ModifierType.MetaMask) != 0;
                    }

                    // Notify the RecentFiles that this item does not exist anymore.
                    // Possible other solution would be to check the recent projects list on focus in
                    // and update them accordingly.
                    if (!System.IO.File.Exists(file))
                    {
                        var res = MessageService.AskQuestion(
                            GettextCatalog.GetString("{0} could not be opened", file),
                            GettextCatalog.GetString("Do you want to remove the reference to it from the Recent list?"),
                            AlertButton.No, AlertButton.Yes);
                        if (res == AlertButton.Yes)
                        {
                            FileService.NotifyFileRemoved(file);
                        }
                        return;
                    }

                    IdeApp.Workspace.OpenWorkspaceItem(file, !inWorkspace);
                }
                else if (uri.StartsWith("monodevelop://"))
                {
                    var cmdId = uri.Substring("monodevelop://".Length);
                    IdeApp.CommandService.DispatchCommand(cmdId, MonoDevelop.Components.Commands.CommandSource.WelcomePage);
                }
                else
                {
                    IdeServices.DesktopService.ShowUrl(uri);
                }
            } catch (Exception ex) {
                LoggingService.LogInternalError(GettextCatalog.GetString("Could not open the url '{0}'", uri), ex);
            }
        }
 void DispatchLink(string uri)
 {
     try {
         if (uri.StartsWith("project://"))
         {
             string           file        = uri.Substring("project://".Length);
             Gdk.ModifierType mtype       = GtkWorkarounds.GetCurrentKeyModifiers();
             bool             inWorkspace = (mtype & Gdk.ModifierType.ControlMask) != 0;
             IdeApp.Workspace.OpenWorkspaceItem(file, !inWorkspace);
         }
         else if (uri.StartsWith("monodevelop://"))
         {
             var cmdId = uri.Substring("monodevelop://".Length);
             IdeApp.CommandService.DispatchCommand(cmdId, MonoDevelop.Components.Commands.CommandSource.WelcomePage);
         }
         else
         {
             DesktopService.ShowUrl(uri);
         }
     } catch (Exception ex) {
         LoggingService.LogInternalError(GettextCatalog.GetString("Could not open the url '{0}'", uri), ex);
     }
 }
Example #5
0
        public static bool IsModifyKeyDown(ModifierType modifierKey)
        {
            ModifierType currentKeyModifiers = GtkWorkarounds.GetCurrentKeyModifiers();

            return((modifierKey & currentKeyModifiers) == modifierKey);
        }