예제 #1
0
        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);
        }
예제 #2
0
 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);
 }