示例#1
0
文件: Exporter.cs 项目: q2een/InvEx
        private void RiseItemPublished(object sender, PublishedItem e)
        {
            e.Publisher = sender as Publisher;

            var temp = System.Threading.Volatile.Read(ref ItemPublished);

            ItemPublished?.Invoke(sender, e);

            exportRepository?.Add(e);
        }
示例#2
0
文件: Exporter.cs 项目: q2een/InvEx
        public async Task <bool> RemovePublishedAsync(PublishedItem publishedItem)
        {
            if (!CanPublishSubjects)
            {
                throw new InvalidOperationException("The database of exported items is not available");
            }

            if (!await publishedItem.Publisher?.RemoveAsync(publishedItem))
            {
                return(false);
            }

            exportRepository?.RemoveAsync(publishedItem);

            await exportRepository?.SaveChangesAsync();

            return(true);
        }
示例#3
0
文件: Publisher.cs 项目: q2een/InvEx
        protected virtual void OnItemPublished(PublishedItem e)
        {
            var temp = System.Threading.Volatile.Read(ref ItemPublished);

            ItemPublished?.Invoke(this, e);
        }
示例#4
0
文件: Publisher.cs 项目: q2een/InvEx
 internal protected abstract Task <bool> RemoveAsync(PublishedItem publishedItem);