Example #1
0
        public override PSAdaptedProperty GetProperty(object baseObject, string propertyName)
        {
            ADEntity aDEntity = baseObject as ADEntity;

            if (aDEntity != null)
            {
                if (!aDEntity.HasMethod(propertyName))
                {
                    return(new PSAdaptedProperty(propertyName, null));
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                object[] typeAdapterTypeName = new object[2];
                typeAdapterTypeName[0] = ADEntityAdapter.TypeAdapterTypeName;
                typeAdapterTypeName[1] = ADEntityAdapter.ADEntityTypeName;
                throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, StringResources.TypeAdapterForADEntityOnly, typeAdapterTypeName));
            }
        }