コード例 #1
0
ファイル: Config.cs プロジェクト: anikolop/FastReport
        internal static void Init()
        {
            FIsRunningOnMono = Type.GetType("Mono.Runtime") != null;

            CheckWebMode();

#if !NETSTANDARD
            if (!WebMode)
            {
                LoadConfig();
            }
#endif

            if (!userSetsScriptSecurity && WebMode)
            {
                enableScriptSecurity = true;    // don't throw event
                scriptSecurityProps  = new ScriptSecurityProperties();
            }

#if !COMMUNITY
            RestoreExportOptions();
#endif
            LoadPlugins();

            // init TextRenderingHint.SystemDefault
            // bug in .Net: if you use any other hint before SystemDefault, the SystemDefault will
            // look like SingleBitPerPixel
            using (Bitmap bmp = new Bitmap(1, 1))
                using (Graphics g = Graphics.FromImage(bmp))
                {
                    g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault;
                    g.DrawString(" ", SystemFonts.DefaultFont, Brushes.Black, 0, 0);
                }
        }
コード例 #2
0
ファイル: Config.cs プロジェクト: zhangbo27/FastReport
        internal static void Init()
        {
            FIsRunningOnMono = Type.GetType("Mono.Runtime") != null;

#if !(NETSTANDARD2_0 || NETSTANDARD2_1)
            string processName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
            WebMode = String.Compare(processName, "iisexpress") == 0 ||
                      String.Compare(processName, "w3wp") == 0;
            if (!WebMode)
            {
                LoadConfig();
            }
#else
            WebMode = true;
#endif
            if (WebMode)
            {
#if !COMMUNITY
                RestoreExportOptions();
                enableScriptSecurity = true;    // don't throw event
                scriptSecurityProps  = new ScriptSecurityProperties();
#endif
            }
            LoadPlugins();

            // init TextRenderingHint.SystemDefault
            // bug in .Net: if you use any other hint before SystemDefault, the SystemDefault will
            // look like SingleBitPerPixel
            using (Bitmap bmp = new Bitmap(1, 1))
                using (Graphics g = Graphics.FromImage(bmp))
                {
                    g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault;
                    g.DrawString(" ", SystemFonts.DefaultFont, Brushes.Black, 0, 0);
                }
        }