示例#1
0
        public IAsyncOperation <RecordItem> GetItemAsync(
            ItemKey key,
            string versionType,
            ItemSectionType sections)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            ItemQuery query = ItemQuery.QueryForKey(key);

            query.View = new ItemView(sections);

            if (!String.IsNullOrEmpty(versionType))
            {
                query.View.TypeVersions.Add(versionType);
            }

            return(AsyncInfo.Run(
                       async cancelToken =>
            {
                ItemQueryResult result = await GetItemsAsync(query).AsTask(cancelToken);
                return result.FirstItem;
            }
                       ));
        }
示例#2
0
        private void UpdateSections(ItemSectionType section)
        {
            StringCollection sections = Sections;

            if ((section & ItemSectionType.Core) != 0)
            {
                sections.Add(ItemSections.Core);
            }
            if ((section & ItemSectionType.Audits) != 0)
            {
                sections.Add(ItemSections.Audits);
            }
            if ((section & ItemSectionType.Blobs) != 0)
            {
                sections.Add(ItemSections.Blobs);
            }
            if ((section & ItemSectionType.Tags) != 0)
            {
                sections.Add(ItemSections.Tags);
            }
            if ((section & ItemSectionType.EffectivePermissions) != 0)
            {
                sections.Add(ItemSections.Permissions);
            }
            if ((section & ItemSectionType.Signatures) != 0)
            {
                sections.Add(ItemSections.Signatures);
            }
            if ((section & ItemSectionType.Data) != 0)
            {
                UpdateXml(string.Empty);
            }
        }
        private void UpdateSections(ItemSectionType section)
        {
            StringCollection sections = Sections;

            if ((section & ItemSectionType.Core) != 0)
            {
                sections.Add(ItemSections.Core);
            }
            if ((section & ItemSectionType.Audits) != 0)
            {
                sections.Add(ItemSections.Audits);
            }
            if ((section & ItemSectionType.Blobs) != 0)
            {
                sections.Add(ItemSections.Blobs);
            }
            if ((section & ItemSectionType.Tags) != 0)
            {
                sections.Add(ItemSections.Tags);
            }
            if ((section & ItemSectionType.EffectivePermissions) != 0)
            {
                sections.Add(ItemSections.Permissions);
            }
            if ((section & ItemSectionType.Signatures) != 0)
            {
                sections.Add(ItemSections.Signatures);
            }
            if ((section & ItemSectionType.Data) != 0)
            {
                UpdateXml(string.Empty);
            }
        }
示例#4
0
        public IAsyncOperation<RecordItem> GetItemAsync(
            ItemKey key,
            string versionType,
            ItemSectionType sections)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }

            ItemQuery query = ItemQuery.QueryForKey(key);
            query.View.SetSections(sections);

            if (!String.IsNullOrEmpty(versionType))
            {
                query.View.TypeVersions.Add(versionType);
            }

            return AsyncInfo.Run(
                async cancelToken =>
                {
                    ItemQueryResult result = await GetItemsAsync(query).AsTask(cancelToken);
                    return result.FirstItem;
                }
                );
        }
示例#5
0
 public IAsyncOperation<RecordItem> GetItemAsync(ItemKey key, ItemSectionType sections)
 {
     return GetItemAsync(key, null, sections);
 }
 public IAsyncOperation <RecordItem> GetItemAsync(ItemKey key, ItemSectionType sections)
 {
     return(m_record.GetItemAsync(key, sections));
 }
 public IAsyncOperation <RecordItem> GetItemAsync(ItemKey key, ItemSectionType sections)
 {
     this.ProduceError();
     return(m_innerStore.GetItemAsync(key, sections));
 }
 public void SetSections(ItemSectionType types)
 {
     UpdateSections(types);
 }
 public ItemView(ItemSectionType types)
 {
     SetSections(types);
 }
示例#10
0
 public void SetSections(ItemSectionType types)
 {
     UpdateSections(types);
 }
示例#11
0
 public ItemView(ItemSectionType types)
 {
     SetSections(types);
 }
 public IAsyncOperation<RecordItem> GetItemAsync(ItemKey key, ItemSectionType sections)
 {
     this.ProduceError();
     return m_innerStore.GetItemAsync(key, sections);
 }