예제 #1
0
파일: Events.cs 프로젝트: 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
        }
예제 #2
0
파일: Events.cs 프로젝트: 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
        }
예제 #3
0
파일: Events.cs 프로젝트: xj0229/gsf
 private static extern bool SetConsoleWindowEventRaising(ConsoleWindowEventHandler handler, [MarshalAs(UnmanagedType.Bool)] bool enable);
예제 #4
0
파일: Events.cs 프로젝트: 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
        }
예제 #5
0
파일: Events.cs 프로젝트: 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
        }
예제 #6
0
파일: Events.cs 프로젝트: rmc00/gsf
 private static extern bool SetConsoleWindowEventRaising(ConsoleWindowEventHandler handler, [MarshalAs(UnmanagedType.Bool)] bool enable);
예제 #7
0
파일: Events.cs 프로젝트: avs009/gsf
 private static extern bool SetConsoleWindowEventRaising(ConsoleWindowEventHandler handler, bool enable);
예제 #8
0
파일: Events.cs 프로젝트: avs009/gsf
 /// <summary>
 /// Enables the raising of console application <see cref="Events"/>. 
 /// </summary>
 public static void DisableRaisingEvents()
 {
     m_handler = HandleConsoleWindowEvents;
     SetConsoleWindowEventRaising(m_handler, false);
 }