コード例 #1
0
        /// <summary>
        /// アンマネージ リソースの解放およびリセットに関連付けられているアプリケーション定義のタスクを実行します。
        /// </summary>
        public void Dispose()
        {
            foreach (var screenContext in screenContexts)
            {
                screenContext.Value.Dispose();
            }
            if (CullingRasterizerState != null && !CullingRasterizerState.Disposed)
            {
                CullingRasterizerState.Dispose();
            }
            if (NonCullingRasterizerState != null && !NonCullingRasterizerState.Disposed)
            {
                NonCullingRasterizerState.Dispose();
            }
            foreach (var disposable in Disposables)
            {
                disposable.Dispose();
            }
            if (D2DFactory != null && !D2DFactory.Disposed)
            {
                D2DFactory.Dispose();
            }
            if (DWFactory != null && !DWFactory.Disposed)
            {
                DWFactory.Dispose();
            }

            if (disposeDeviceManager)
            {
                DeviceManager.Dispose();
            }
        }
コード例 #2
0
ファイル: DirectXFactory.cs プロジェクト: chihuai/LiPTT
        public static List <string> GetInstalledFontNames()
        {
            List <string> li    = new List <string>();
            var           fonts = DWFactory.GetSystemFontCollection(false);

            int count = fonts.FontFamilyCount;

            for (int i = 0; i < fonts.FontFamilyCount; i++)
            {
                var FontFamily  = fonts.GetFontFamily(i);
                var FamilyNames = FontFamily.FamilyNames;

                string name;
                int    index;

                if (FamilyNames.FindLocaleName("zh-TW", out index))
                {
                    name = FamilyNames.GetString(index);
                }
                else if (FamilyNames.FindLocaleName("zh-CN", out index))
                {
                    name = FamilyNames.GetString(index);
                }
                else if (FamilyNames.FindLocaleName("ja", out index))
                {
                    name = FamilyNames.GetString(index);
                }
                else if (FamilyNames.FindLocaleName("ko", out index))
                {
                    name = FamilyNames.GetString(index);
                }
                else if (FamilyNames.FindLocaleName("en-US", out index))
                {
                    name = FamilyNames.GetString(index);
                }
                else
                {
                    name = FamilyNames.GetString(index);
                }
                li.Add(name);
            }

            li.Sort();

            return(li);
        }