Exemplo n.º 1
0
        public void Dispose()
        {
            lock (syncRoot)
            {
                if (!disposed)
                {
                    disposed = true;
                    viewsBySheet?.Values.Where(l => l != null)
                    .SelectMany(v => v)
                    .Where(v => v != null)
                    .ToList()
                    .ForEach(v => {
                        v.ViewSheet.Change            -= OnSheetChange;
                        v.ViewSheet.SelectionChange   -= OnSelectionChange;
                        v.ViewSheet.BeforeDoubleClick -= OnBeforeBoubleClick;
                        //v.Dispose();
                    });

                    contextualMenuManager.OnContextualMenusRequested -= ManageViewsContextualMenu;

                    //@@if (templateContextualMenuManager != null)
                    //{
                    //    templateContextualMenuManager.Dispose();
                    //    templateContextualMenuManager = null;
                    //}

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