コード例 #1
0
        /// <summary>
        /// Indicates whether the specified file is already loaded by a reader or writer.
        /// </summary>
        /// <param name="name">Infinite file name.</param>
        /// <param name="path">Infinite file path.</param>
        /// <returns>Returns true if the store is already loaded.</returns>
        public static bool IsActive(string name, string path)
        {
            if (!EventWaitHandle.TryOpenExisting(InfiniteFileWriter.PulseEventName(path, name), out EventWaitHandle eventHandle))
            {
                return(false);
            }

            eventHandle.Dispose();
            return(true);
        }
コード例 #2
0
        public InfiniteFileReader(string path, string fileName, int fileId = 0)
        {
            this.path     = path;
            this.fileName = fileName;
            this.fileId   = fileId;
            Mutex pulse;

            Mutex.TryOpenExisting(InfiniteFileWriter.PulseEventName(path, fileName), out pulse);
            this.writePulse = pulse ?? new Mutex(false);
        }