Esempio n. 1
0
        internal static object Deserialize(PSObject psObject)
        {
            if (psObject == null)
            {
                throw new ArgumentNullException("psObject");
            }
            if (psObject.Members["SerializationData"] != null && psObject.Members["SerializationData"].Value == null)
            {
                throw new ArgumentException("Cannot deserialize PSObject, SerializationData is missing.");
            }
            Type type = MonadCommand.ResolveType(psObject);

            if (psObject.Members["EMCMockEngineEnabled"] != null)
            {
                return(MockObjectInformation.TranslateToMockObject(type, psObject));
            }
            return(MonadCommand.TypeConverter.ConvertFrom(psObject, type, null, true));
        }
 internal static object CreateDummyObject(Type type)
 {
     return(MockObjectInformation.GetCreator(type.FullName).CreateDummyObject(type));
 }
 internal static object TranslateToMockObject(Type type, PSObject psObject)
 {
     return(MockObjectInformation.GetCreator(type.FullName).TranslateToMockObject(type, psObject));
 }