public KernelEventSupport(SerializationInfo info, StreamingContext context)
		{
			events = new EventHandlerList();

			events[HandlerRegisteredEvent] = (Delegate) 
				 info.GetValue("HandlerRegisteredEvent", typeof(Delegate));
		}
 public void AddHandlers(EventHandlerList listToAddFrom)
 {
     for (ListEntry entry = listToAddFrom.head; entry != null; entry = entry.next)
     {
         this.AddHandler(entry.key, entry.handler);
     }
 }
 public void AddHandlers(EventHandlerList listToAddFrom)
 {
     for (ListEntry entry = listToAddFrom.head; entry != null; entry = entry.next)
     {
         this.AddHandler(entry.key, entry.handler);
     }
 }
		/// <summary>
		/// Cleans up the COM object references.
		/// </summary>
		/// <param name="disposing">
		/// <see langword="true"/> if this was called from the
		/// <see cref="IDisposable"/> interface.
		/// </param>
		protected virtual void Dispose(bool disposing)
		{
			if (disposing)
			{
				_owner = null;
				_unmappedEventKeys = null;
				
				if (null != _events)
				{
					_events.Dispose();
					_events = null;
				}
			}
			
			if (null != _connectionPoint)
			{
				if (0 != _connectionCookie)
				{
					_connectionPoint.Unadvise(_connectionCookie);
					_connectionCookie = 0;
				}
				
				while( Marshal.ReleaseComObject(_connectionPoint) > 0 );
				_connectionPoint = null;
			}
		}
        public DeviceContextWpf(DeviceSettings settings)
        {
            Contract.Requires(settings != null);

            Settings = settings;
            LogEvent.Engine.Log(settings.ToString());

            eventHandlerList = new EventHandlerList();

            LogEvent.Engine.Log(Resources.INFO_OE_DeviceCreating);
            //SwapChainDescription swapChainDesc = new SwapChainDescription
            //                                         {
            //                                             BufferCount = 1,
            //                                             ModeDescription =
            //                                                 new ModeDescription(Settings.ScreenWidth, Settings.ScreenHeight,
            //                                                                     new Rational(120, 1), Settings.Format),
            //                                             IsWindowed = true,
            //                                             OutputHandle =(new System.Windows.Interop.WindowInteropHelper(Global.Window)).Handle,
            //                                             SampleDescription = Settings.SampleDescription,
            //                                             SwapEffect = SwapEffect.Discard,
            //                                             Usage = Usage.RenderTargetOutput,
            //                                         };

            //LogEvent.Engine.Log(Resources.INFO_OE_DeviceCreating);
            //Device.CreateWithSwapChain(DriverType.Hardware, Settings.CreationFlags, swapChainDesc, out device, out swapChain);
            device = new Device(DriverType.Hardware, Settings.CreationFlags, FeatureLevel.Level_11_0);

            //if (!Settings.IsWindowed)

            immediate = device.ImmediateContext;

            CreateTargets();
            LogEvent.Engine.Log(Resources.INFO_OE_DeviceCreated);
            device.ImmediateContext.Flush();
        }
 public DesignerHost(DesignSurface surface)
 {
     this._surface = surface;
     this._state = new BitVector32();
     this._designers = new Hashtable();
     this._events = new EventHandlerList();
     DesignSurfaceServiceContainer service = this.GetService(typeof(DesignSurfaceServiceContainer)) as DesignSurfaceServiceContainer;
     if (service != null)
     {
         foreach (Type type in DefaultServices)
         {
             service.AddFixedService(type, this);
         }
     }
     else
     {
         IServiceContainer container2 = this.GetService(typeof(IServiceContainer)) as IServiceContainer;
         if (container2 != null)
         {
             foreach (Type type2 in DefaultServices)
             {
                 container2.AddService(type2, this);
             }
         }
     }
 }
Exemple #7
0
		internal DOMObject (WebBrowser control)
		{
			this.control = control;
			IntPtr p = Base.StringInit ();
			storage = new HandleRef (this, p);
			resources = new Hashtable ();
			event_handlers = null;
		}
 /// <devdoc> allows you to add a list of events to this list </devdoc>
 public void AddHandlers(EventHandlerList listToAddFrom) {
  
     ListEntry currentListEntry = listToAddFrom.head;
     while (currentListEntry != null) {
         AddHandler(currentListEntry.key, currentListEntry.handler);
         currentListEntry = currentListEntry.next;
     }
 }
 public AbstractKernelEvents()
 {
     m_events = new EventHandlerList();
     m_service2Key = new Hashtable();
     m_dependencyToSatisfy = new Hashtable();
     m_proxy2ComponentWrapper = new Hashtable();
     InterceptedComponentBuilder = new DefaultInterceptedComponentBuilder();
 }
        protected void RemoveClickEvent(Button b)
        {
            System.Reflection.FieldInfo f1 = typeof(Button).GetField("EventClick", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
            object obj = f1.GetValue(b);

            System.Reflection.PropertyInfo         pi   = typeof(Button).GetProperty("Events", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
            System.ComponentModel.EventHandlerList list = (System.ComponentModel.EventHandlerList)pi.GetValue(b, null);
            list.RemoveHandler(obj, list[obj]);
        }
    public void Add(EventPrivateKey key, Delegate handler)
    {
      if (_directEventHandlers == null)
      {
        _directEventHandlers = new EventHandlerList();
      }

      _directEventHandlers.AddHandler(key, handler);
    }
        public EventPropertyDescriptor(object component, EventInfo eventInfo, EventHandlerList eventHandlerList)
            : base(eventInfo.Name)
        {
            this.component = component;
            this.eventInfo = eventInfo;
            this.eventHandlerList = eventHandlerList;

            this.converter = new EventInfoConverter(this);
        }
Exemple #13
0
		public void AddHandlers (EventHandlerList listToAddFrom)
		{
			if (listToAddFrom == null) {
				return;
			}

			for (ListNode entry = listToAddFrom.head; entry != null; entry = entry.next) {
				AddHandler (entry.key, entry.value);
			}
		}
 public BaseFileConfigurationSourceImplementation(string configurationFilepath)
 {
     this.lockMe = new object();
     this.refresh = true;
     this.eventHandlersLock = new object();
     this.eventHandlers = new EventHandlerList();
     this.configurationFilepath = configurationFilepath;
     this.watchedConfigSourceMapping = new Dictionary<string, ConfigurationSourceWatcher>();
     this.watchedSectionMapping = new Dictionary<string, ConfigurationSourceWatcher>();
 }
Exemple #15
0
        /// <summary> allows you to add a list of events to this list </summary>
        public void AddHandlers(EventHandlerList listToAddFrom)
        {
            ListEntry currentListEntry = listToAddFrom._head;

            while (currentListEntry != null)
            {
                AddHandler(currentListEntry.key, currentListEntry.handler);
                currentListEntry = currentListEntry.next;
            }
        }
Exemple #16
0
 /// <summary>Adds a list of delegates to the current list.</summary>
 /// <param name="listToAddFrom">The list to add.</param>
 public void AddHandlers(EventHandlerList listToAddFrom)
 {
     if (listToAddFrom == null)
     {
         return;
     }
     for (ListEntry next = listToAddFrom.entries; next != null; next = next.next)
     {
         this.AddHandler(next.key, next.value);
     }
 }
    /// <include file='CodeDoc\DockContentHandler.xml' path='//CodeDoc/Class[@name="DockContentHandler"]/Constructor[@name="(Form, GetPersistStringDelegate)"]/*'/>
    public DockContentHandler(Form form, GetPersistStringDelegate getPersistStringDelegate) {
      if (!(form is IDockContent))
        throw new ArgumentException();

      m_form = form;
      m_getPersistStringDelegate = getPersistStringDelegate;

      m_events = new EventHandlerList();
      Form.Disposed += new EventHandler(Form_Disposed);
      Form.TextChanged += new EventHandler(Form_TextChanged);
    }
		public DockContentHandler(Form form, GetPersistStringCallback getPersistStringCallback) {
			if (!(form is IDockContent))
				throw new ArgumentException(Strings.DockContent_Constructor_InvalidForm, "form");

			m_form = form;
			m_getPersistStringCallback = getPersistStringCallback;

			m_events = new EventHandlerList();
			Form.Disposed += new EventHandler(Form_Disposed);
			Form.TextChanged += new EventHandler(Form_TextChanged);
		}
        public EventSuppressor(Component source)
        {
            if (source == null)
                throw new ArgumentNullException("control", "An instance of a control must be provided.");

            _source = source;
            _sourceType = _source.GetType();
            _sourceEventsInfo = _sourceType.GetProperty("Events", BindingFlags.Instance | BindingFlags.NonPublic);
            _sourceEventHandlerList = (EventHandlerList)_sourceEventsInfo.GetValue(_source, null);
            _eventHandlerListType = _sourceEventHandlerList.GetType();
            _headFI = _eventHandlerListType.GetField("head", BindingFlags.Instance | BindingFlags.NonPublic);
        }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         this.DisconnectFromEvents();
         if (this.events != null)
         {
             this.events.Dispose();
             this.events = null;
         }
     }
 }
        public DockContentHandler(Form form, GetPersistStringCallback getPersistStringCallback)
        {
            if (!(form is IDockContent))
                throw new ArgumentException(Strings.DockContent_Constructor_InvalidForm, "form");

            this._mForm = form;
            this.m_getPersistStringCallback = getPersistStringCallback;

            (form as DockContent).Size = form.Size;

            this._mEvents = new EventHandlerList();
            this.Form.Disposed += this.Form_Disposed;
            this.Form.TextChanged += this.Form_TextChanged;
        }
Exemple #22
0
 public UIHierarchy(IServiceProvider serviceProvider, ConfigurationContext configurationContext)
 {
     if (serviceProvider == null)
     {
         throw new ArgumentNullException("serviceProvider");
     }
     this.serviceProvider = serviceProvider;
     this.configurationContext = configurationContext;
     this.configDomain = new ConfigurationDesignManagerDomain(serviceProvider);
     nodesByType = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     nodesById = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     nodesByName = new Hashtable(CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
     storageTable = new StorageTable();
     handlerList = new EventHandlerList();
 }
Exemple #23
0
        public void AddHandlers(EventHandlerList listToAddFrom)
        {
            if (listToAddFrom == null)
            {
                return;
            }

            ListEntry entry = listToAddFrom.entries;

            while (entry != null)
            {
                AddHandler(entry.key, entry.value);
                entry = entry.next;
            }
        }
        public DeviceContext11(IntPtr handle, DeviceSettings settings)
        {
            Contract.Requires(handle != IntPtr.Zero);
            Contract.Requires(settings != null);

            Settings = settings;
            LogEvent.Engine.Log(settings.ToString());

            eventHandlerList = new EventHandlerList();
            SwapChainDescription swapChainDesc = new SwapChainDescription
                                                     {
                                                         BufferCount = 1,
                                                         IsWindowed = Settings.IsWindowed,
                                                         ModeDescription =
                                                             new ModeDescription{
                                                                 Width = Settings.ScreenWidth,
                                                                 Height = Settings.ScreenHeight,
                                                                 RefreshRate= new Rational(0, 1),
                                                                 Format = Settings.Format,
                                                                 Scaling = DisplayModeScaling.Unspecified,
                                                                 ScanlineOrdering = DisplayModeScanlineOrdering.Unspecified,
                                                             },

                                                         //new Rational(120, 1), Settings.Format),
                                                         OutputHandle = handle,
                                                         SampleDescription = Settings.SampleDescription,
                                                         Flags = SwapChainFlags.AllowModeSwitch,
                                                         SwapEffect = SwapEffect.Discard,
                                                         Usage = Usage.RenderTargetOutput,
                                                     };

            FeatureLevel[] featureLevels = new FeatureLevel[] { FeatureLevel.Level_11_0, FeatureLevel.Level_10_1, FeatureLevel.Level_10_0 };
            LogEvent.Engine.Log(Resources.INFO_OE_DeviceCreating);
            Device.CreateWithSwapChain(DriverType.Hardware, Settings.CreationFlags, featureLevels, swapChainDesc, out device, out swapChain);

            factory = swapChain.GetParent<Factory>();
            factory.SetWindowAssociation(handle, WindowAssociationFlags.IgnoreAltEnter | WindowAssociationFlags.IgnoreAll);

            immediate = device.ImmediateContext;

            CreateTargets();
            LogEvent.Engine.Log(Resources.INFO_OE_DeviceCreated);
        }
        /// <summary>
        /// Initialize a new instance of the <see cref="ConfigurationUIHierarchy"/> class.
        /// </summary>
        /// <param name="rootNode">The root node of the hierarchy.</param>
        /// <param name="serviceProvider">The a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.</param>
        public ConfigurationUIHierarchy(ConfigurationApplicationNode rootNode, IServiceProvider serviceProvider)
        {
            if (rootNode == null) throw new ArgumentNullException("rootNode");
            if (serviceProvider == null) throw new ArgumentNullException("serviceProvider");

            this.storageSerivce = new StorageService();
            this.configDomain = new ConfigurationDesignManagerDomain(serviceProvider);
            this.serviceProvider = serviceProvider;
            nodesByType = new Dictionary<Guid,NodeTypeEntryArrayList>();
            nodesById = new Dictionary<Guid, ConfigurationNode>();
            nodesByName = new Dictionary<Guid, Dictionary<string, ConfigurationNode>>();
            handlerList = new EventHandlerList();
            this.rootNode = rootNode;
            this.storageSerivce.ConfigurationFile = this.rootNode.ConfigurationFile;
            this.rootNode.Renamed += new EventHandler<ConfigurationNodeChangedEventArgs>(OnConfigurationFileChanged);
            selectedNode = rootNode;
            AddNode(rootNode);
            if (null != rootNode.FirstNode) rootNode.UpdateHierarchy(rootNode.FirstNode);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="FileBasedConfigurationSource"/> class.
        /// </summary>
        /// <param name="configurationFilepath">The path for the main configuration file.</param>
        /// <param name="refresh"><b>true</b>if runtime changes should be refreshed, <b>false</b> otherwise.</param>
        /// <param name="refreshInterval">The poll interval in milliseconds.</param>
        protected FileBasedConfigurationSource(string configurationFilepath, bool refresh, int refreshInterval)
        {
            this.configurationFilepath = configurationFilepath;
            this.refresh = refresh && !string.IsNullOrEmpty(configurationFilepath);
            this.refreshInterval = refreshInterval;
            this.refreshLock = new object();

            this.eventHandlersLock = new object();
            this.eventHandlers = new EventHandlerList();

            this.watchersLock = new object();
            this.watchedConfigSourceMapping = new Dictionary<string, ConfigurationSourceWatcher>();
            this.watchedSectionMapping = new Dictionary<string, ConfigurationSourceWatcher>();

            CompositeConfigurationHandler = new CompositeConfigurationSourceHandler(this);
            CompositeConfigurationHandler.ConfigurationSectionChanged += new ConfigurationChangedEventHandler(handler_ConfigurationSectionChanged);
            CompositeConfigurationHandler.ConfigurationSourceChanged += new EventHandler<ConfigurationSourceChangedEventArgs>(handler_ConfigurationSourceChanged);

            HierarchicalConfigurationHandler = new HierarchicalConfigurationSourceHandler(this);
            HierarchicalConfigurationHandler.ConfigurationSectionChanged += new ConfigurationChangedEventHandler(handler_ConfigurationSectionChanged);
            HierarchicalConfigurationHandler.ConfigurationSourceChanged += new EventHandler<ConfigurationSourceChangedEventArgs>(handler_ConfigurationSourceChanged);
        }
Exemple #27
0
		/// <summary>
		/// Constructs a new PNode.
		/// </summary>
		/// <Remarks>
		/// By default a node's brush is null, and bounds are empty. These values
		/// must be set for the node to show up on the screen once it's added to
		/// a scene graph.
		/// </Remarks>
		public PNode() {
			bounds = RectangleF.Empty;
			fullBoundsCache = RectangleF.Empty;
			pickable = true;
			childrenPickable = true;
			matrix = new PMatrix();
			handlers = new EventHandlerList();
			Visible = true;
		}
 static EventManager()
 {
     events = new EventHandlerList();
 }
Exemple #29
0
 public Component()
 {
     event_handlers = null;
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenDEHEventInitiator"/> class.
		/// </summary>
		public NuGenDEHEventInitiator(object eventSender, EventHandlerList eventHandlers)
			: base(eventSender, eventHandlers)
		{
		}
 /// <summary>Initializes a new instance of the <see cref="T:System.ComponentModel.Component" /> class. </summary>
 public Component()
 {
     this.event_handlers = null;
 }
        /// <devdoc>
        ///    <para>Enables a control to perform final cleanup.</para>
        /// </devdoc>
        public virtual void Dispose() {
            IContainer container = null;

            if (Site != null) {
                container = (IContainer)Site.GetService(typeof(IContainer));
                if (container != null) {
                    container.Remove(this);
                    EventHandler disp = Events[EventDisposed] as EventHandler;
                    if (disp != null)
                        disp(this, EventArgs.Empty);
                }
            }

            if (_occasionalFields != null) {
                _occasionalFields.Dispose();
                //do not null out for backwards compat, VSWhidbey 475940
                //_occasionalFields = null;
            }

            if (_events != null) {
                _events.Dispose();
                _events = null;
            }
        }
		/// <summary>
		/// Initialize a new instance of the <see cref="ConfigurationUIHierarchyService"/> class.
		/// </summary>
        public ConfigurationUIHierarchyService()
        {
            hierarchies = new Dictionary<Guid,IConfigurationUIHierarchy>();
            handlerList = new EventHandlerList();
        }
Exemple #34
0
 public EventPropertyDescriptor(object component, System.Reflection.EventInfo eventInfo, System.ComponentModel.EventHandlerList eventHandlerList) : base(eventInfo.Name)
 {
     this.component        = component;
     this.eventInfo        = eventInfo;
     this.eventHandlerList = eventHandlerList;
     this.converter        = new EventInfoConverter(this);
 }
Exemple #35
0
		void AddEventHandler (object key, EventHandler handler)
		{
			if (events == null)
				events = new EventHandlerList ();
			events.AddHandler (key, handler);
		}
		public void All ()
		{
			EventHandlerList list = new EventHandlerList ();
			string i1 = "i1";
			string i2 = "i2";
			EventHandler one = new EventHandler (Deleg1);
			EventHandler two = new EventHandler (Deleg2);
			EventHandler d;

			Assertion.AssertEquals ("All #01", null, list [i1]);
			Assertion.AssertEquals ("All #02", null, list [i2]);

			list.AddHandler (i1, one);
			d = list [i1] as EventHandler;
			Assertion.Assert ("All #03", d != null);

			d (this, EventArgs.Empty);
			Assertion.AssertEquals ("All #04", 1, calls);

			list.AddHandler (i2, two);
			d = list [i1] as EventHandler;
			Assertion.Assert ("All #05", d != null);

			d (this, EventArgs.Empty);
			Assertion.AssertEquals ("All #06", 2, calls);

			d = list [i2] as EventHandler;
			Assertion.Assert ("All #07", d != null);

			d (this, EventArgs.Empty);
			Assertion.AssertEquals ("All #08", 4, calls);

			list.AddHandler (i2, two);
			d = list [i2] as EventHandler;
			Assertion.Assert ("All #08", d != null);

			d (this, EventArgs.Empty);
			Assertion.AssertEquals ("All #09", 16, calls);

			list.RemoveHandler (i1, one);
			d = list [i1] as EventHandler;
			Assertion.Assert ("All #10", d == null);

			list.RemoveHandler (i2, two);
			d = list [i2] as EventHandler;
			Assertion.Assert ("All #11", d != null);

			list.RemoveHandler (i2, two);
			d = list [i2] as EventHandler;
			Assertion.Assert ("All #12", d == null);

			list.AddHandler (i1, one);
			d = list [i1] as EventHandler;
			Assertion.Assert ("All #13", d != null);

			list.AddHandler (i2, two);
			d = list [i2] as EventHandler;
			Assertion.Assert ("All #14", d != null);

			list.AddHandler (i1, null);
			Assertion.Assert ("All #15", list [i1] != null);

			list.AddHandler (i2, null);
			Assertion.Assert ("All #16", list [i2] != null);

			list.Dispose ();
		}
        internal ChoicePropertyFilter(
            DeviceSpecificChoice choice,
            IDeviceSpecificDesigner designer,
            ISite site
        ) {
            _events = new EventHandlerList();
            _choice = choice;
            _site = site;
            _designer = designer;

            CreateLocalCopiesOfObjects();
        }
		/// <summary>
		/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
		/// </summary>
		public void Dispose()
		{
			if (_events != null)
			{
				_events.Dispose();
				_events = null;
			}
		}
 public Sample()
 {
     Events = new EventHandlerList();
 }
Exemple #40
0
 public void AddHandlers(EventHandlerList listToAddFrom)
 {
     throw new NotImplementedException();
 }