public override void Initialize(System.ComponentModel.IComponent component) { base.Initialize(component); IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); if (host == null) { return; } IInheritanceService inheritanceService = (IInheritanceService)GetService(typeof(IInheritanceService)); m_inheritanceService = new InlineInheritanceService(this, inheritanceService); host.RemoveService(typeof(IInheritanceService)); host.AddService(typeof(IInheritanceService), m_inheritanceService); }
protected override void Dispose(bool disposing) { if (disposing) { IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); if (host != null) { if (m_inheritanceService != null) { host.RemoveService(typeof(IInheritanceService)); if (m_inheritanceService.m_parentService != null) { host.AddService(typeof(IInheritanceService), m_inheritanceService.m_parentService); } m_inheritanceService.Dispose(); m_inheritanceService = null; } } } base.Dispose(disposing); }