static bool SetCurrentPlatform(GraphicsPlatform actualImpl)
 {
     //must init once
     lock (initLock)
     {
         if (s_selectedGfxPlatform == null)
         {
             s_selectedGfxPlatform = actualImpl;
             return true;
         }
     }
     return false;
 } 
示例#2
0
        //-----------------------------------------

        public static void StartGraphicsHost()
        {
            lock (startLock)
            {
                if (isStarted) return;

                var startParams = new LayoutFarm.UI.GdiPlus.MyWinGdiPortalSetupParameters();
                startParams.IcuDataFile = IcuDataFile;
                gdiPlatform = LayoutFarm.UI.GdiPlus.MyWinGdiPortal.Start(startParams);
                uiPlatformWinForm = new LayoutFarm.UI.UIPlatformWinForm();
                UI.UIPlatform.CurrentUIPlatform = uiPlatformWinForm;
                //--------------------
                isStarted = true;
                //--------------------
            }
        }
示例#3
0
        //-----------------------------------------

        public static void StartGraphicsHost()
        {
            lock (startLock)
            {
                if (isStarted)
                {
                    return;
                }

                var startParams = new LayoutFarm.UI.GdiPlus.MyWinGdiPortalSetupParameters();
                startParams.IcuDataFile         = IcuDataFile;
                gdiPlatform                     = LayoutFarm.UI.GdiPlus.MyWinGdiPortal.Start(startParams);
                uiPlatformWinForm               = new LayoutFarm.UI.UIPlatformWinForm();
                UI.UIPlatform.CurrentUIPlatform = uiPlatformWinForm;
                //--------------------
                isStarted = true;
                //--------------------
            }
        }
 /// <summary>
 /// Get pen to be used for border draw respecting its style.
 /// </summary>
 static Pen GetPen(GraphicsPlatform platform, CssBorderStyle style, Color color, float width)
 {
     var p = new Pen(color);
     p.Width = width;
     switch (style)
     {
         case CssBorderStyle.Solid:// "solid":
             p.DashStyle = DashStyle.Solid;
             break;
         case CssBorderStyle.Dotted:// "dotted":
             p.DashStyle = DashStyle.Dot;
             break;
         case CssBorderStyle.Dashed:// "dashed":
             p.DashStyle = DashStyle.Dash;
             if (p.Width < 2)
                 p.DashPattern = new[] { 4, 4f }; // better looking
             break;
     }
     return p;
 }