Example #1
0
        /// <summary>
        /// Opens a window with the specified help topic.
        /// </summary>
        /// <param name="topic"></param>
        public static void ShowHelp(Topic topic)
        {
            if (!sTopicMap.TryGetValue(topic, out string fileName))
            {
                Debug.Assert(false, "Unable to find " + topic + " in map");
                return;
            }

            string helpFilePath = Path.Combine(RuntimeDataAccess.GetDirectory(),
                                               HELP_DIR, fileName);

            if (!File.Exists(helpFilePath))
            {
                // Alternate path, used during development.  If it also doesn't exist, leave
                // the original path intact so the error message is useful.
                string altPath = Path.Combine(RuntimeDataAccess.GetDirectory() +
                                              "\\..\\..\\docs\\sgmanual",
                                              fileName);
                altPath = Path.GetFullPath(altPath);    // normalize
                if (File.Exists(altPath))
                {
                    helpFilePath = altPath;
                }
            }
            string url = "file://" + helpFilePath;

            //url = url.Replace("#", "%23");
            Debug.WriteLine("Requesting help URL: " + url);
            ShellCommand.OpenUrl(url);
        }
Example #2
0
        /// <summary>
        /// Opens a window with the specified help topic.
        /// </summary>
        /// <param name="topic"></param>
        public static void ShowHelp(Topic topic)
        {
            if (!sTopicMap.TryGetValue(topic, out string fileName))
            {
                Debug.Assert(false, "Unable to find " + topic + " in map");
                return;
            }

            string helpFilePath = Path.Combine(RuntimeDataAccess.GetDirectory(),
                                               HELP_DIR, fileName);
            string url = "file://" + helpFilePath;

            //url = url.Replace("#", "%23");
            Debug.WriteLine("Requesting help URL: " + url);
            ShellCommand.OpenUrl(url);
        }