public HandlerEntry(object handler, EventHandlerService.HandlerEntry next)
 {
     this.handler = handler;
     this.next = next;
 }
 private object OnCreateService(IServiceContainer container, System.Type serviceType)
 {
     if (serviceType == typeof(IEventHandlerService))
     {
         if (this.eventHandlerService == null)
         {
             this.eventHandlerService = new EventHandlerService(this.frame);
         }
         return this.eventHandlerService;
     }
     if (serviceType == typeof(ToolStripAdornerWindowService))
     {
         return new ToolStripAdornerWindowService(base.Component.Site, this.frame);
     }
     return null;
 }
Ejemplo n.º 3
0
		// Get the service from the site
		internal Object GetServiceFromSite(Type type)
		{
			Object service = _serviceContainer.GetService(type);
			if (service != null)
				return service;

			// These are the site local services
			if (type.Equals(typeof(IInheritanceService))) {
				AddService(typeof(IInheritanceService), new InheritanceService());
				return GetService(type);
			}
			if (type.Equals(typeof(AmbientProperties))) {
				AddService(typeof(AmbientProperties), new AmbientProperties());
				return GetService(type);
			}
			if (type.Equals(typeof(IDictionaryService))) {
				AddService(typeof(IDictionaryService), this);
				return GetService(type);
			}
			if (type.Equals(typeof(IComponentChangeService))) {
				AddService(typeof(IComponentChangeService),this);
				return GetService(type);
			}
			if (type.Equals(typeof(ITypeDescriptorFilterService))) {
				AddService(typeof(ITypeDescriptorFilterService), this);
				return GetService(type);
			}
			if (type.Equals(typeof(IInheritanceService))) {
				AddService(typeof(IInheritanceService),this);
				return GetService(type);
			}
			if (type.FullName.Equals(_ehServiceTypeName)) {
				Object ehService = new EventHandlerService((Control)_component);
				AddService(type, ehService);
				return GetService(type);
			}
			return service;
		}