Ejemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Checks to see whether this instance is connected to the requested project. If so,
        /// starts up the requested app or activates a main window for that app if already
        /// running.
        /// </summary>
        /// <param name="projectId">The requested project ID.</param>
        /// <param name="args">The application arguments</param>
        /// <returns>The result of checking to see if the specified project matches the
        /// project this instance is running</returns>
        /// ------------------------------------------------------------------------------------
        public ProjectMatch HandleOpenProjectRequest(ProjectId projectId, FwAppArgs args)
        {
            ProjectMatch isMyProject = FieldWorks.GetProjectMatchStatus(projectId);

            if (isMyProject != ProjectMatch.ItsMyProject)
            {
                return(isMyProject);
            }

            FieldWorks.KickOffAppFromOtherProcess(args);
            return(ProjectMatch.ItsMyProject);            // The request has been handled at this point
        }
Ejemplo n.º 2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Handles the specified link request.
        /// </summary>
        /// <param name="link">The link.</param>
        /// <returns>True if the link was successfully handled, false otherwise.</returns>
        /// ------------------------------------------------------------------------------------
        public bool HandleLinkRequest(FwAppArgs link)
        {
            ProjectMatch isMyProject = FieldWorks.GetProjectMatchStatus(
                new ProjectId(link.DatabaseType, link.Database));

            if (isMyProject != ProjectMatch.ItsMyProject)
            {
                return(false);
            }

            FieldWorks.FollowLink(link);
            return(true);
        }
Ejemplo n.º 3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Checks to see whether this instance is connected to the requested project. If so,
        /// attempts to do a restore using the specified restore settings.
        /// </summary>
        /// <param name="restoreSettings">The restore settings.</param>
        /// <returns>True if the project belonged to this instance and the restore was
        /// successful, false otherwise.</returns>
        /// ------------------------------------------------------------------------------------
        public bool HandleRestoreProjectRequest(FwRestoreProjectSettings restoreSettings)
        {
            ProjectMatch isMyProject = FieldWorks.GetProjectMatchStatus(
                new ProjectId(restoreSettings.Settings.FullProjectPath));

            if (isMyProject != ProjectMatch.ItsMyProject)
            {
                return(false);
            }

            FieldWorks.HandleRestoreRequest(restoreSettings);
            return(true);
        }