void ReleaseDesignerOutlets()
        {
            if (CatView != null)
            {
                CatView.Dispose();
                CatView = null;
            }

            if (PageView != null)
            {
                PageView.Dispose();
                PageView = null;
            }

            if (PreviousButton != null)
            {
                PreviousButton.Dispose();
                PreviousButton = null;
            }

            if (NextButton != null)
            {
                NextButton.Dispose();
                NextButton = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BackgroundView != null)
            {
                BackgroundView.Dispose();
                BackgroundView = null;
            }

            if (BasicButton != null)
            {
                BasicButton.Dispose();
                BasicButton = null;
            }

            if (CancelButton != null)
            {
                CancelButton.Dispose();
                CancelButton = null;
            }

            if (DefenseButton != null)
            {
                DefenseButton.Dispose();
                DefenseButton = null;
            }

            if (DescriptionButton != null)
            {
                DescriptionButton.Dispose();
                DescriptionButton = null;
            }

            if (FeatsButton != null)
            {
                FeatsButton.Dispose();
                FeatsButton = null;
            }

            if (HeaderLabel != null)
            {
                HeaderLabel.Dispose();
                HeaderLabel = null;
            }

            if (HeaderView != null)
            {
                HeaderView.Dispose();
                HeaderView = null;
            }

            if (OffenseButton != null)
            {
                OffenseButton.Dispose();
                OffenseButton = null;
            }

            if (OKButton != null)
            {
                OKButton.Dispose();
                OKButton = null;
            }

            if (PageBorderView != null)
            {
                PageBorderView.Dispose();
                PageBorderView = null;
            }

            if (PageView != null)
            {
                PageView.Dispose();
                PageView = null;
            }

            if (SpecialButton != null)
            {
                SpecialButton.Dispose();
                SpecialButton = null;
            }

            if (StatisticsButton != null)
            {
                StatisticsButton.Dispose();
                StatisticsButton = null;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Освободить все используемые ресурсы.
        /// </summary>
        /// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (this.PagePreview != null)
                {
                    this.PagePreview.SelectedIndexChanged -= PagePreviewSelectedIndexChanged;
                    this.PagePreview.Items.Clear();
                    if (InvokeRequired)
                    {
                        Invoke((MethodInvoker)(PagePreview.Dispose));
                    }
                    else
                    {
                        PagePreview.Dispose();
                    }
                    this.PagePreview = null;
                }

                if (PagePreviewImages != null)
                {
                    PagePreviewImages.Images.Clear();
                    if (InvokeRequired)
                    {
                        Invoke((MethodInvoker)(PagePreviewImages.Dispose));
                    }
                    else
                    {
                        PagePreviewImages.Dispose();
                    }
                    PagePreviewImages = null;
                }

                if (this.PageView != null)
                {
                    Subscribe_PageView_ClientSizeChanged(false);
                    if (InvokeRequired)
                    {
                        Invoke((MethodInvoker)(PageView.Dispose));
                    }
                    else
                    {
                        PageView.Dispose();
                    }
                    this.PageView = null;
                }

                if (DocPages != null)
                {
                    DocPages.Clear();
                }
            }

            System.GC.Collect();

            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }