//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------- namespace System.Runtime.DurableInstancing { using System.Collections.Generic; using System.Collections.ObjectModel; using System.Xml.Linq; [Fx.Tag.XamlVisible(false)] public sealed class InstanceLockQueryResult : InstanceStoreQueryResult { static readonly ReadOnlyDictionaryInternal EmptyQueryResult = new ReadOnlyDictionaryInternal(new Dictionary(0)); // Zero public InstanceLockQueryResult() { InstanceOwnerIds = EmptyQueryResult; } // One public InstanceLockQueryResult(Guid instanceId, Guid instanceOwnerId) { Dictionary owners = new Dictionary(1); owners.Add(instanceId, instanceOwnerId); InstanceOwnerIds = new ReadOnlyDictionaryInternal(owners); } // N public InstanceLockQueryResult(IDictionary instanceOwnerIds) { Dictionary copy = new Dictionary(instanceOwnerIds); InstanceOwnerIds = new ReadOnlyDictionaryInternal(copy); } public IDictionary InstanceOwnerIds { get; private set; } } }