public ExternalRmsServerInfoMap(string path, int maxCount, IMruDictionaryPerfCounters perfCounters)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }
            string uniqueFileNameForProcess = RmsClientManagerUtils.GetUniqueFileNameForProcess("ExternalRmsServerInfo_1.dat");

            this.dictionary = new MruDictionary <Uri, ExternalRMSServerInfo>(maxCount, new ExternalRmsServerInfoMap.UriComparer(), perfCounters);
            this.serializer = new MruDictionarySerializer <Uri, ExternalRMSServerInfo>(path, uniqueFileNameForProcess, ExternalRMSServerInfo.ColumnNames, new MruDictionarySerializerRead <Uri, ExternalRMSServerInfo>(ExternalRmsServerInfoMap.TryReadValues), new MruDictionarySerializerWrite <Uri, ExternalRMSServerInfo>(ExternalRmsServerInfoMap.TryWriteValues), perfCounters);
            if (!this.serializer.TryReadFromDisk(this.dictionary))
            {
                ExternalRmsServerInfoMap.Tracer.TraceError <string>(0L, "External Rms Server Info Map failed to read map-file ({0}).", uniqueFileNameForProcess);
            }
        }
예제 #2
0
        public RmsLicenseStoreInfoMap(string path, int maxCount, IMruDictionaryPerfCounters perfCounters)
        {
            if (string.IsNullOrEmpty(path))
            {
                throw new ArgumentNullException("path");
            }
            this.path = path;
            string uniqueFileNameForProcess = RmsClientManagerUtils.GetUniqueFileNameForProcess("RmsLicenseStoreInfoMap_2.dat");

            this.dictionary             = new MruDictionary <MultiValueKey, RmsLicenseStoreInfo>(maxCount, new RmsLicenseStoreInfoMap.MultiValueKeyComparer(), perfCounters);
            this.dictionary.OnRemoved  += this.MruDictionaryOnRemoved;
            this.dictionary.OnReplaced += this.MruDictionaryOnReplaced;
            this.serializer             = new MruDictionarySerializer <MultiValueKey, RmsLicenseStoreInfo>(path, uniqueFileNameForProcess, RmsLicenseStoreInfo.ColumnNames, new MruDictionarySerializerRead <MultiValueKey, RmsLicenseStoreInfo>(RmsLicenseStoreInfoMap.TryReadValues), new MruDictionarySerializerWrite <MultiValueKey, RmsLicenseStoreInfo>(RmsLicenseStoreInfoMap.TryWriteValues), perfCounters);
            if (!this.serializer.TryReadFromDisk(this.dictionary))
            {
                RmsLicenseStoreInfoMap.Tracer.TraceError <string>(0L, "Rms License Store Info Map failed to read map-file ({0}).", uniqueFileNameForProcess);
            }
        }