Exemple #1
0
        public static void RemoveAttachment(this object parent, string name)
        {
            var attchments = WeakAttachmentsManager.GetAttachments(parent);

            if (attchments != null)
            {
                attchments.SetAttachment(name, null);
            }
        }
Exemple #2
0
        public static object GetAttachment(this object parent, string name)
        {
            var attchments = WeakAttachmentsManager.GetAttachments(parent);

            if (attchments != null)
            {
                return(attchments.GetAttachment(name));
            }
            return(null);
        }
Exemple #3
0
 public static void SetAttachment(this object parent, string name, object attach)
 {
     if (name == null)
     {
         ClearAttachments(parent);
     }
     else if (attach == null)
     {
         RemoveAttachment(parent, name);
     }
     else
     {
         WeakAttachmentsManager.GetOrCreateAttachments(parent).SetAttachment(name, attach);
     }
 }
Exemple #4
0
 public static void ClearAttachments(this object parent)
 {
     WeakAttachmentsManager.ClearAttachments(parent);
 }