Beispiel #1
0
        /// <summary>Determines whether the font is installed on the system.</summary>
        /// <param name="fontName">The font name.</param>
        /// <returns>The <see cref="bool" />.</returns>
        public static bool FontInstalled(string fontName)
        {
            if (string.IsNullOrEmpty(fontName))
            {
                throw new ArgumentNullException(ExceptionMessenger.IsNullOrEmpty(fontName));
            }

            return(InstalledFonts().Any(_fontFamily => _fontFamily.Name == fontName));
        }
        /// <summary>Loads the assembly file.</summary>
        /// <param name="file">The file path.</param>
        /// <returns>The <see cref="Assembly" />.</returns>
        private static Assembly LoadAssembly(string file)
        {
            if (string.IsNullOrEmpty(file))
            {
                VisualExceptionDialog.Show(new NoNullAllowedException(ExceptionMessenger.IsNullOrEmpty(file)));
            }

            if (!File.Exists(file))
            {
                VisualExceptionDialog.Show(new NoNullAllowedException(ExceptionMessenger.FileNotFound(file)));
            }

            return(Assembly.LoadFile(file));
        }
        /// <summary>Loads the assembly file.</summary>
        /// <param name="file">The file path.</param>
        /// <returns>The <see cref="Assembly" />.</returns>
        public static Assembly LoadAssembly(string file)
        {
            if (string.IsNullOrEmpty(file))
            {
                ConsoleEx.WriteDebug(new NoNullAllowedException(ExceptionMessenger.IsNullOrEmpty(file)));
            }

            if (!File.Exists(file))
            {
                ConsoleEx.WriteDebug(new NoNullAllowedException(ExceptionMessenger.FileNotFound(file)));
            }

            return(Assembly.LoadFile(file));
        }