コード例 #1
0
ファイル: DUIHandler.cs プロジェクト: xcxooxl/DUICreator
        private DuiContainer AddDuiInternal(string renderTarget, string modelName, string url)
        {
            var duiContainer = new DuiContainer();
            var res          = SetupScreen(url, renderTarget, modelName);

            duiContainer.TxdHandle        = res.Item1;
            duiContainer.TargetHandle     = res.Item2;
            duiContainer.duiObj           = res.Item3;
            duiContainer.UniqId           = res.Item4;
            duiContainer.RenderTargetName = renderTarget;
            return(duiContainer);
        }
コード例 #2
0
ファイル: DUIHandler.cs プロジェクト: xcxooxl/DUICreator
        private DuiContainer ReuseDuiContainer(string renderTarget, string url)
        {
            DuiContainer duiContainer = DeletedContainers[renderTarget][0];

            DeletedContainers[renderTarget].Remove(duiContainer);
            if (!DeletedContainers[renderTarget].Any())
            {
                DeletedContainers.Remove(renderTarget);
            }
            API.SetDuiUrl(duiContainer.duiObj, url);
            return(duiContainer);
        }
コード例 #3
0
ファイル: DUIHandler.cs プロジェクト: xcxooxl/DUICreator
        private void RemoveDuiContainer(DuiContainer duiContainer)
        {
            API.SetDuiUrl(duiContainer.duiObj, "about:blank");
            //API.DestroyDui(duiContainer.duiObj);

            foreach (var prop in duiContainer.Props)
            {
                prop.Delete();
            }

            if (!DeletedContainers.ContainsKey(duiContainer.RenderTargetName))
            {
                DeletedContainers[duiContainer.RenderTargetName] = new List <DuiContainer>();
            }

            DeletedContainers[duiContainer.RenderTargetName].Add(duiContainer);
            DuiContainers[duiContainer.RenderTargetName].Remove(duiContainer);
            if (!DuiContainers[duiContainer.RenderTargetName].Any())
            {
                DuiContainers.Remove(duiContainer.RenderTargetName);
            }
        }
コード例 #4
0
ファイル: DUIHandler.cs プロジェクト: xcxooxl/DUICreator
        public async Task <DuiContainer> AddDui(String renderTarget, string url)
        {
            //API.RemoveIpl("ex_dt1_11_office_01a");
            //API.RequestIpl("ex_dt1_11_office_01a");
            DuiContainer duiContainer = null;

            if (DeletedContainers.ContainsKey(renderTarget) && DeletedContainers[renderTarget].Any())
            {
                duiContainer = ReuseDuiContainer(renderTarget, url);
            }

            var propAndModelName = await CreateModelForRender(renderTarget);

            var modelName = propAndModelName.Item2;

            if (duiContainer == null)
            {
                duiContainer = AddDuiInternal(renderTarget, modelName, url);
            }
            duiContainer.Props = new List <Prop>()
            {
                propAndModelName.Item1
            };
            if (!DuiContainers.ContainsKey(renderTarget))
            {
                DuiContainers.Add(renderTarget, new List <DuiContainer>());
            }

            DuiContainers[renderTarget].Add(duiContainer);
            if (!UsedRenderTargets.Contains(renderTarget))
            {
                //Function.Call((Hash)0xE9F6FFE837354DD4, duiContainer.RenderTargetName);
                UsedRenderTargets.Add(renderTarget);
            }
            return(duiContainer);
        }