Esempio n. 1
0
        public static string Cut([CanBeNull] object target, [CanBeNull] LinkedMemberInfo memberInfo)
        {
            lastOperationFailed = true;

            if (memberInfo != null)
            {
                cutMemberInfo = SerializableMemberInfo.Serialize(memberInfo);
            }
            ObjectReference    = target as Object;
            hasObjectReference = objectReference != null;

            if (target != null)
            {
                copiedType = target.GetType();
            }
            else if (memberInfo != null)
            {
                copiedType = memberInfo.Type;
            }
            else
            {
                throw new NullReferenceException("Clipboard.Cut both target and memberInfo were null");
            }

            Content = PrettySerializer.Serialize(target);
            isCut   = true;

            lastOperationFailed = false;

            return(Content);
        }
Esempio n. 2
0
 public static byte[] Serialize([NotNull] LinkedMemberInfo memberInfo)
 {
     using (var serialize = new SerializableMemberInfo(memberInfo))
     {
         return(serialize.Serialize());
     }
 }