예제 #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);