Esempio n. 1
0
File: Events.cs Progetto: xj0229/gsf
        /// <summary>
        /// Enables the raising of console application <see cref="Events"/>.
        /// </summary>
        /// <remarks>
        /// This method is currently ignored under Mono deployments.
        /// </remarks>
        public static void DisableRaisingEvents()
        {
            s_handler = HandleConsoleWindowEvents;
#if !MONO
            SetConsoleWindowEventRaising(s_handler, false);
#endif
        }
Esempio n. 2
0
File: Events.cs Progetto: xj0229/gsf
        /// <summary>
        /// Enables the raising of console application <see cref="Events"/>. Prior to calling this method, handlers
        /// must be defined for the <see cref="Events"/> raised by a console application.
        /// </summary>
        /// <remarks>
        /// This method is currently ignored under Mono deployments.
        /// </remarks>
        public static void EnableRaisingEvents()
        {
            s_handler = HandleConsoleWindowEvents;

#if !MONO
            // Member variable is used here so that the delegate is not garbage collected by the time it is called
            // by WIN API when any of the control events take place.
            // http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=996045&SiteID=1
            SetConsoleWindowEventRaising(s_handler, true);
#endif
        }
Esempio n. 3
0
File: Events.cs Progetto: xj0229/gsf
 private static extern bool SetConsoleWindowEventRaising(ConsoleWindowEventHandler handler, [MarshalAs(UnmanagedType.Bool)] bool enable);
Esempio n. 4
0
File: Events.cs Progetto: rmc00/gsf
        /// <summary>
        /// Enables the raising of console application <see cref="Events"/>. 
        /// </summary>
        /// <remarks>
        /// This method is currently ignored under Mono deployments.
        /// </remarks>
        public static void DisableRaisingEvents()
        {
            s_handler = HandleConsoleWindowEvents;
#if !MONO
            SetConsoleWindowEventRaising(s_handler, false);
#endif
        }
Esempio n. 5
0
File: Events.cs Progetto: rmc00/gsf
        /// <summary>
        /// Enables the raising of console application <see cref="Events"/>. Prior to calling this method, handlers 
        /// must be defined for the <see cref="Events"/> raised by a console application.
        /// </summary>
        /// <remarks>
        /// This method is currently ignored under Mono deployments.
        /// </remarks>
        public static void EnableRaisingEvents()
        {
            s_handler = HandleConsoleWindowEvents;
#if !MONO

            // Member variable is used here so that the delegate is not garbage collected by the time it is called
            // by WIN API when any of the control events take place.
            // http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=996045&SiteID=1
            SetConsoleWindowEventRaising(s_handler, true);
#endif
        }
Esempio n. 6
0
File: Events.cs Progetto: rmc00/gsf
 private static extern bool SetConsoleWindowEventRaising(ConsoleWindowEventHandler handler, [MarshalAs(UnmanagedType.Bool)] bool enable);
Esempio n. 7
0
File: Events.cs Progetto: avs009/gsf
 private static extern bool SetConsoleWindowEventRaising(ConsoleWindowEventHandler handler, bool enable);
Esempio n. 8
0
File: Events.cs Progetto: avs009/gsf
 /// <summary>
 /// Enables the raising of console application <see cref="Events"/>. 
 /// </summary>
 public static void DisableRaisingEvents()
 {
     m_handler = HandleConsoleWindowEvents;
     SetConsoleWindowEventRaising(m_handler, false);
 }