Ejemplo n.º 1
0
 public void RequestGC()
 {
     GCWorker.GCRequest(-1, GCWorker.GCType.GCAll);
 }
Ejemplo n.º 2
0
        private void ApplyFlashQuality(bool ReloadRequired = false)
        {
            if (!this.firstLoaded)
            {
                return;
            }

            try
            {
                var document = this.WebBrowser.Document as HTMLDocument;
                if (document == null)
                {
                    return;
                }

                var frames = document.frames;
                for (var i = 0; i < frames.length; i++)
                {
                    var item     = frames.item(i);
                    var provider = item as IServiceProvider;
                    if (provider == null)
                    {
                        continue;
                    }

                    object ppvObject;
                    provider.QueryService(typeof(IWebBrowserApp).GUID, typeof(IWebBrowser2).GUID, out ppvObject);
                    var webBrowser = ppvObject as IWebBrowser2;

                    var iframeDocument = webBrowser?.Document as HTMLDocument;
                    if (iframeDocument == null)
                    {
                        continue;
                    }

                    string qualityString = "high";
                    switch (KanColleSettings.FlashElementQuality.Value)
                    {
                    case FlashQuality.Low: qualityString = "low"; break;

                    case FlashQuality.Medium: qualityString = "medium"; break;

                    case FlashQuality.High: qualityString = "high"; break;
                    }

                    var script = "";
                    script += "function kcsFlash_StartFlash(a){var b={id:'externalswf',width:'800',height:'480',wmode:'opaque',quality:'" + qualityString + "',bgcolor:'#000000',allowScriptAccess:'always'};document.getElementById('flashWrap').innerHTML=ConstMessageInfo.InstallFlashMessage,gadgets.flash.embedFlash(a+ConstURLInfo.MainFlashURL+'?api_token='+flashInfo.apiToken+'&api_starttime='+flashInfo.apiStartTime,document.getElementById('flashWrap'),6,b),document.getElementById('adFlashWrap').style.height='0px',document.getElementById('wsFlashWrap').style.height='0px',document.getElementById('flashWrap').style.height='480px',gadgets.window.adjustHeight(ConstGadgetInfo.height)};";
                    if (ReloadRequired)
                    {
                        script += "kcsLogin_StartLogin();";
                    }

                    webBrowser.Navigate("javascript:" + script);

                    GCWorker.GCRequest();
                }
            }
            catch (Exception) when(Application.Instance.State == ApplicationState.Startup)
            {
                // about:blank だから仕方ない
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                StatusService.Current.Notify("failed to apply css: " + ex.Message);
            }
        }
Ejemplo n.º 3
0
 public void RequestGC()
 {
     GCWorker.GCRequest();
 }