Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Controller = null;
                Cell       = null;

                if (DataContext != null)
                {
                    _DataContext.RemoveNotifyPropertyChangedHandler(_DataContext.Source, this);
                    _DataContext.RemoveNotifyPropertyChangedHandler(_DataContext.DataContextSource, this);
                    DataContext.Dispose();
                }

                Value = default(T);

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

            base.Dispose(disposing);
        }
Exemplo n.º 2
0
        public static Theme CreateTheme(Theme theme)
        {
            var newTheme = CreateTheme();

            newTheme.MergeTheme(theme);
            if (theme != null)
            {
                theme.Dispose();
            }

            return(newTheme);
        }
Exemplo n.º 3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                var dc = this as IDataContext <MemberData>;
                if (dc != null)
                {
                    dc.DataContext.Dispose();
                }

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

            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (BackgroundImage != null)
                {
                    BackgroundImage = null;
                }

                _LeftFixedSpace.Dispose();
                _RightFixedSpace.Dispose();

                var source = TableView.Source as ViewSource;
                if (source != null)
                {
                    foreach (var section in source.Sections.Values)
                    {
                        foreach (var listSource in section.ListSources.Values)
                        {
                            if (listSource != null)
                            {
                                listSource.Dispose();
                            }
                        }
                    }

                    source.Dispose();
                }

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

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

                if (RootView != null)
                {
                    var disposable = RootView as IDisposable;
                    if (disposable != null)
                    {
                        disposable.Dispose();
                        RootView = null;
                    }
                }

                if (ToolbarButtons != null)
                {
                    foreach (var button in ToolbarButtons)
                    {
                        button.Dispose();
                    }
                }

                if (NavbarButtons != null)
                {
                    foreach (var button in NavbarButtons)
                    {
                        button.Dispose();
                    }
                }

                Theme.Dispose();
                Theme = null;
            }

            base.Dispose(disposing);
        }
Exemplo n.º 5
0
		public static Theme CreateTheme(Theme theme)
		{
			var newTheme = CreateTheme();

			newTheme.MergeTheme(theme);
			if (theme != null)
			{
				theme.Dispose();
			}

			return newTheme;
		}