コード例 #1
0
        /// <summary>
        /// create new UIViewport based on this control's current platform
        /// </summary>
        /// <returns></returns>
        public UISurfaceViewportControl CreateNewOne(int w, int h, InnerViewportKind innerViewportKind)
        {
            //each viewport has its own root graphics

            UISurfaceViewportControl newViewportControl = new UISurfaceViewportControl();

            newViewportControl.Size = new System.Drawing.Size(w, h);
            RootGraphic         newRootGraphic = _rootgfx.CreateNewOne(w, h);
            ITopWindowEventRoot topEventRoot   = null;

            if (newRootGraphic is ITopWindowEventRootProvider)
            {
                topEventRoot = ((ITopWindowEventRootProvider)newRootGraphic).EventRoot;
            }
            newViewportControl.InitRootGraphics(
                newRootGraphic,//new root
                topEventRoot,
                innerViewportKind);
            return(newViewportControl);
        }