Esempio n. 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);
            }
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public override PSMemberInfo Copy()
 {
     PSAliasProperty destiny = new PSAliasProperty(base.name, this.referencedMemberName) {
         conversionType = this.conversionType
     };
     base.CloneBaseProperties(destiny);
     return destiny;
 }
Esempio n. 4
0
        public override PSMemberInfo Copy()
        {
            PSAliasProperty destiny = new PSAliasProperty(base.name, this.referencedMemberName)
            {
                conversionType = this.conversionType
            };

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