コード例 #1
0
ファイル: MainWindow.cs プロジェクト: valoni/TinyCLR-Samples
        public void RegisterWindow(ApplicationWindow aw)
        {
            aw.Parent      = this;
            aw.Id          = this.applicationWindows.Count;
            aw.Icon.Width  = this.Width / IconColum;
            aw.Icon.Height = aw.Icon.Width + (3 * aw.Icon.Font.Height) / 2;

            this.applicationWindows.Add(aw);


            if (this.applicationWindows.Count >= IconColum)
            {
                this.UpdateScreen();
            }
        }
コード例 #2
0
        public void RegisterWindow(ApplicationWindow aw)
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();


            aw.Parent      = this;
            aw.Id          = this.applicationWindows.Count;
            aw.Icon.Width  = this.Width / IconColum;
            aw.Icon.Height = aw.Icon.Width + (3 * aw.Icon.Font.Height) / 2;

            this.applicationWindows.Add(aw);


            if (this.applicationWindows.Count >= IconColum)
            {
                this.UpdateScreen();
            }
        }
コード例 #3
0
        public void RegisterWindow(ApplicationWindow aw)
        {
            if (this.applicationWindows.Count == MaxWindows)
            {
                throw new ArgumentOutOfRangeException("No more than " + MaxWindows + " windows");
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();

            aw.Parent      = this;
            aw.Id          = this.applicationWindows.Count;
            aw.Icon.Width  = this.Width / IconColum;
            aw.Icon.Height = aw.Icon.Width;

            var r = this.applicationWindows.Count / IconColum;

            this.applicationWindows.Add(aw);

            this.iconStackPanels[r].Children.Clear();

            for (var i = 0; i < IconColum; i++)
            {
                if (r * IconColum + i >= this.applicationWindows.Count)
                {
                    break;
                }

                var a = (ApplicationWindow)this.applicationWindows[r * IconColum + i];

                if (a != null)
                {
                    this.iconStackPanels[r].Children.Add(a.Icon);
                    a.Icon.Click += this.Icon_Click;
                }
            }

            this.UpdateScreen();
        }