コード例 #1
0
        public static ResourceChangedSender GetSender(ResourceItem resourceFile, bool isDeleted = false, ResourceData oldResourceData = null)
        {
            if (ResourceChangedFactory.senderCollection.ContainsKey(resourceFile))
            {
                return((ResourceChangedSender)ResourceChangedFactory.defaultEmptySender);
            }
            ResourceChangedSender resourceChangedSender = new ResourceChangedSender(resourceFile, isDeleted, oldResourceData);

            ResourceChangedFactory.senderCollection[resourceFile] = resourceChangedSender;
            resourceChangedSender.Disposed += new Action <ResourceChangedSender, ResourceItem>(ResourceChangedFactory.Sender_Disposed);
            return(resourceChangedSender);
        }
コード例 #2
0
 private static void Sender_Disposed(ResourceChangedSender obj, ResourceItem e)
 {
     obj.Disposed -= new Action <ResourceChangedSender, ResourceItem>(ResourceChangedFactory.Sender_Disposed);
     ResourceChangedFactory.senderCollection.Remove(e);
 }