Exemplo n.º 1
0
        public void ShowHelp(IHelpOnForm help)
        {
            if (help == null)
            {
                return;
            }

            var fullNameWithLanguage = GetHelpfileFullName(help, true);

            if (string.IsNullOrEmpty(fullNameWithLanguage))
            {
                MessageBox.ShowInfo(HelpProviderMessages.NoHelpExists, HelpProviderMessages.MessageBoxTitle);
                return;
            }

            if (FileExists(fullNameWithLanguage))
            {
                OpenHelpfile(fullNameWithLanguage);
                return;
            }

            var fullNameWithoutLanguage = GetHelpfileFullName(help, false);

            if (FileExists(fullNameWithoutLanguage))
            {
                OpenHelpfile(fullNameWithoutLanguage);
                return;
            }

            MessageBox.ShowInfo(string.Format(HelpProviderMessages.NoSuchHelpfileFound, fullNameWithLanguage),
                                HelpProviderMessages.MessageBoxTitle);
        }
        protected override string GetHelpfileFullName(IHelpOnForm help, bool useLanguage)
        {
            var helpfilename = GetHelpFileNameWithoutPath(help, useLanguage);

            return(!string.IsNullOrEmpty(helpfilename)
                ? Path.Combine(Application.StartupPath, "HelpFiles", helpfilename)
                : null);
        }
        protected override string GetHelpfileFullName(IHelpOnForm help, bool useLanguage)
        {
            var helpfilename = GetHelpFileNameWithoutPath(help, useLanguage);

            return(!string.IsNullOrEmpty(helpfilename)
                ? HelpProviderSettings.SharepointPath + helpfilename
                : null);
        }
Exemplo n.º 4
0
        private static string GetPluginShortcut(IHelpOnForm help)
        {
            string pluginShortcut   = null;
            var    identifiableForm = help as IIdentifiableForm;

            if (identifiableForm == null)
            {
                return(null);
            }

            return(pluginShortcut);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Answers the name of the helpfile including extension, but without path.
        /// </summary>
        /// <param name="help">instance of form</param>
        /// <param name="withLanguage"><c>true</c> if language suffix should be appended, <c>false</c> if not.</param>
        protected string GetHelpFileNameWithoutPath(IHelpOnForm help, bool withLanguage)
        {
            if (help == null)
            {
                return(null);
            }

            var pluginShortcut = GetPluginShortcut(help);

            var helpFileName = string.IsNullOrEmpty(help.HelpFileName)
                ? pluginShortcut
                : help.HelpFileName;

            return(string.IsNullOrEmpty(helpFileName)
                ? null
                : string.Format("{0}{1}{2}", helpFileName, withLanguage ? GetLanguageSuffix() : null,
                                help.HelpFileExtension));
        }
Exemplo n.º 6
0
 /// <summary>
 /// Answers the full qualified name of the helpfile with or without language suffix.
 /// </summary>
 protected abstract string GetHelpfileFullName(IHelpOnForm help, bool useLanguage);
Exemplo n.º 7
0
 public CommandShowHelp(IHelpOnForm help)
 {
     _help = help;
 }