// Token: 0x06000542 RID: 1346 RVA: 0x00013C98 File Offset: 0x00011E98
        public XElement GetXElementSnapshot(string keyName = null)
        {
            bool flag = false;

            if (this.clusterHandle == null || this.clusterHandle.IsInvalid)
            {
                this.clusterHandle = ClusapiMethods.OpenCluster(null);
                flag = true;
            }
            XElement xelementSnapshotInternal;

            try
            {
                using (IDistributedStoreKey distributedStoreKey = ClusterDbKey.GetBaseKey(this.clusterHandle, DxStoreKeyAccessMode.Read))
                {
                    this.baseKey             = distributedStoreKey;
                    xelementSnapshotInternal = this.GetXElementSnapshotInternal(keyName);
                }
            }
            finally
            {
                if (flag && this.clusterHandle != null && !this.clusterHandle.IsInvalid)
                {
                    this.clusterHandle.Close();
                    this.clusterHandle = null;
                }
            }
            return(xelementSnapshotInternal);
        }
Пример #2
0
        public IDistributedStoreKey GetBaseKeyByStoreKind(DxStoreKeyAccessMode mode, DistributedStore.Context context, StoreKind storeKind)
        {
            IDistributedStoreKey result;

            switch (storeKind)
            {
            case StoreKind.Clusdb:
                result = ClusterDbKey.GetBaseKey(context.ClusterHandle, mode);
                break;

            case StoreKind.DxStore:
                result = this.DxStoreKeyFactoryInstance.GetBaseKey(mode, context.ChannelFactory, context.NodeName, false);
                break;

            default:
                result = null;
                break;
            }
            return(result);
        }