Example #1
0
        void LazyUpdateNotifyText()
        {
            if (lazyUpdateNotifyTextTimer == null)
            {
                lazyUpdateNotifyTextTimer =
                    new Lib.CancelableTimeout(
                        UpdateNotifierText,
                        1000);
            }

            lazyUpdateNotifyTextTimer.Start();
        }
Example #2
0
        public void LazyStatusBarUpdater()
        {
            // create on demand
            if (lazyStatusBarUpdateTimer == null)
            {
                lazyStatusBarUpdateTimer =
                    new Lib.CancelableTimeout(
                        UpdateStatusBar,
                        300);
            }

            lazyStatusBarUpdateTimer.Start();
        }
Example #3
0
        public void LazyGC()
        {
            // Create on demand.
            if (lazyGCTimer == null)
            {
                var delay = Lib.Utils.Str2Int(StrConst("LazyGCDelay"));

                lazyGCTimer = new Lib.CancelableTimeout(
                    () =>
                {
                    System.GC.Collect();
                }, delay * 1000);
            }

            lazyGCTimer.Start();
        }
Example #4
0
        void LazySaveServerList()
        {
            // create on demand
            if (lazySaveServerListTimer == null)
            {
                var delay = Lib.Utils.Str2Int(StrConst("LazySaveServerListDelay"));

                lazySaveServerListTimer =
                    new Lib.CancelableTimeout(
                        () => setting.SaveServerList(serverList),
                        delay * 1000);
            }

            lazySaveServerListTimer.Start();

            LazyUpdateNotifyText();
        }
Example #5
0
        void LazyShowSearchResult()
        {
            // create on demand
            if (lazyShowSearchResultTimer == null)
            {
                var delay = Lib.Utils.Str2Int(StrConst("LazySaveServerListDelay"));

                lazyShowSearchResultTimer =
                    new Lib.CancelableTimeout(
                        () =>
                {
                    // 如果不RemoveAll会乱序
                    RemoveAllServersConrol();

                    // 修改搜索项时应该清除选择,否则会有可显示列表外的选中项
                    servers.SetAllServerIsSelected(false);

                    RefreshUI();
                },
                        600);
            }

            lazyShowSearchResultTimer.Start();
        }