示例#1
0
        private void LookupMember(string name, HybridDictionary visitedAliases, out PSMemberInfo returnedMember, out bool hasCycle)
        {
            returnedMember = null;
            if (base.instance == null)
            {
                throw new ExtendedTypeSystemException("AliasLookupMemberOutsidePSObject", null, ExtendedTypeSystem.AccessMemberOutsidePSObject, new object[] { name });
            }
            PSMemberInfo info = PSObject.AsPSObject(base.instance).Properties[name];

            if (info == null)
            {
                throw new ExtendedTypeSystemException("AliasLookupMemberNotPresent", null, ExtendedTypeSystem.MemberNotPresent, new object[] { name });
            }
            PSAliasProperty property = info as PSAliasProperty;

            if (property == null)
            {
                hasCycle       = false;
                returnedMember = info;
            }
            else if (visitedAliases.Contains(name))
            {
                hasCycle = true;
            }
            else
            {
                visitedAliases.Add(name, name);
                this.LookupMember(property.ReferencedMemberName, visitedAliases, out returnedMember, out hasCycle);
            }
        }
示例#2
0
        public override PSMemberInfo Copy()
        {
            PSAliasProperty psAliasProperty = new PSAliasProperty(this.name, this.referencedMemberName);

            psAliasProperty.conversionType = this.conversionType;
            this.CloneBaseProperties((PSMemberInfo)psAliasProperty);
            return((PSMemberInfo)psAliasProperty);
        }
示例#3
0
 public override PSMemberInfo Copy()
 {
     PSAliasProperty destiny = new PSAliasProperty(base.name, this.referencedMemberName) {
         conversionType = this.conversionType
     };
     base.CloneBaseProperties(destiny);
     return destiny;
 }
示例#4
0
        public override PSMemberInfo Copy()
        {
            PSAliasProperty destiny = new PSAliasProperty(base.name, this.referencedMemberName)
            {
                conversionType = this.conversionType
            };

            base.CloneBaseProperties(destiny);
            return(destiny);
        }