Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new <see cref="RemovableDriveWatcher"/>.
        /// </summary>
        /// <returns>
        /// A new instance of the <see cref="RemovableDriveWatcher"/> class,
        /// if none has been created yet; otherwise, the singleton instance.
        /// </returns>
        public static RemovableDriveWatcher Create()
        {
            if (instance == null)
            {
                instance = new RemovableDriveWatcher();
                instance.StartInsertWatcher();
                instance.StartRemoveWatcher();
            }

            return(instance);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new <see cref="RemovableDriveWatcher"/>.
        /// </summary>
        /// <returns>
        /// A new instance of the <see cref="RemovableDriveWatcher"/> class,
        /// if none has been created yet; otherwise, the singleton instance.
        /// </returns>
        public static RemovableDriveWatcher Create()
        {
            if (instance == null)
            {
                instance = new RemovableDriveWatcher();
                instance.StartInsertWatcher();
                instance.StartRemoveWatcher();
            }

            return instance;
        }