Ejemplo n.º 1
0
 private static object GenerateMemberSet(string name, object obj)
 {
     PSObject psObject = PSObject.AsPSObject(obj);
     PSMemberInfo member = psObject.InstanceMembers[name];
     if (member == null)
     {
         PSInternalMemberSet set = new PSInternalMemberSet(name, psObject) {
             ShouldSerialize = false,
             isHidden = true,
             isReservedMember = true
         };
         member = set;
         psObject.InstanceMembers.Add(member);
         member.instance = psObject;
     }
     return member;
 }
Ejemplo n.º 2
0
        private static object GenerateMemberSet(string name, object obj)
        {
            PSObject     psObject = PSObject.AsPSObject(obj);
            PSMemberInfo member   = psObject.InstanceMembers[name];

            if (member == null)
            {
                PSInternalMemberSet set = new PSInternalMemberSet(name, psObject)
                {
                    ShouldSerialize  = false,
                    isHidden         = true,
                    isReservedMember = true
                };
                member = set;
                psObject.InstanceMembers.Add(member);
                member.instance = psObject;
            }
            return(member);
        }