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