Example #1
1
        /// <exclude/>
        public Lookup(SerializationInfo serializationInfo, StreamingContext streamingContext)
        {
            int version = 0;

            if (SerializationVersionExists)
            {
                try
                {
                    version = serializationInfo.GetInt32("SerializationVersion");
                }
                catch (SerializationException)
                {
                    // ignore
                    SerializationVersionExists = false;
                }
            }
            _alias = serializationInfo.GetString("Alias");
            _aliasPlural = serializationInfo.GetString("AliasPlural");
            _enabled = serializationInfo.GetBoolean("Enabled");
            _isUserDefined = serializationInfo.GetBoolean("IsUserDefined");
            _name = serializationInfo.GetString("Name");
            _userOptions = (List<IUserOption>)serializationInfo.GetValue("UserOptions", ModelTypes.UserOptionList);
            _description = serializationInfo.GetString("Description");
            _backingObject = (ScriptObject)serializationInfo.GetValue("BackingObject", ModelTypes.ScriptObject);
            _idColumn = (Column)serializationInfo.GetValue("IdColumn", ModelTypes.Column);
            _nameColumn = (Column)serializationInfo.GetValue("NameColumn", ModelTypes.Column);
            _LookupValues = (List<LookupValue>)serializationInfo.GetValue("LookupValues", ModelTypes.LookupValueList);
        }
		protected ProxyObjectReference(SerializationInfo info, StreamingContext context)
		{
			// Deserialize the base type using its assembly qualified name
			string qualifiedName = info.GetString("__baseType");
			_baseType = System.Type.GetType(qualifiedName, true, false);

			// Rebuild the list of interfaces
			var interfaceList = new List<System.Type>();
			int interfaceCount = info.GetInt32("__baseInterfaceCount");
			for (int i = 0; i < interfaceCount; i++)
			{
				string keyName = string.Format("__baseInterface{0}", i);
				string currentQualifiedName = info.GetString(keyName);
				System.Type interfaceType = System.Type.GetType(currentQualifiedName, true, false);

				interfaceList.Add(interfaceType);
			}

			// Reconstruct the proxy
			var factory = new ProxyFactory();
			System.Type proxyType = factory.CreateProxyType(_baseType, interfaceList.ToArray());

			// Initialize the proxy with the deserialized data
			var args = new object[] {info, context};
			_proxy = (IProxy) Activator.CreateInstance(proxyType, args);
		}
	// Constructor.
	public MemberInfoSerializationHolder(SerializationInfo info,
									StreamingContext context)
			{
				if(info == null)
				{
					throw new ArgumentNullException("info");
				}
				memberType = (MemberTypes)(info.GetInt32("MemberType"));
				name = info.GetString("Name");
				signature = info.GetString("Signature");
				String assemblyName = info.GetString("AssemblyName");
				String className = info.GetString("ClassName");
				if(assemblyName == null || className == null)
				{
					throw new SerializationException
						(_("Serialize_StateMissing"));
				}
				Assembly assembly = FormatterServices.GetAssemblyByName
					(assemblyName);
				if(assembly == null)
				{
					throw new SerializationException
						(_("Serialize_StateMissing"));
				}
				containingType = FormatterServices.GetTypeFromAssembly
					(assembly, className);
			}
Example #4
0
 private VideoFile(SerializationInfo info, DeserializeInfo di)
     : this(di.Server, di.Info, di.Type)
 {
     actors = info.GetValue("a", typeof(string[])) as string[];
       description = info.GetString("de");
       director = info.GetString("di");
       genre = info.GetString("g");
       title = info.GetString("t");
       try {
     width = info.GetInt32("w");
     height = info.GetInt32("h");
       }
       catch (Exception) {
       }
       var ts = info.GetInt64("du");
       if (ts > 0) {
     duration = new TimeSpan(ts);
       }
       try {
     bookmark = info.GetInt64("b");
       }
       catch (Exception) {
     bookmark = 0;
       }
       try {
     subTitle = info.GetValue("st", typeof(Subtitle)) as Subtitle;
       }
       catch (Exception) {
     subTitle = null;
       }
       initialized = true;
 }
Example #5
0
 /// <inheritdoc/>
 protected InRangeException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     actual = info.GetString("Actual");
     high = info.GetString("High");
     low = info.GetString("Low");
 }
 protected MandrillException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Status = info.GetString("Status");
     Code = (int?) info.GetValue("Code", typeof (int?));
     Name = info.GetString("Name");
 }
Example #7
0
        /// <summary>
        /// Initializes a new instance of the ProxyObjectReference class.
        /// </summary>
        /// <param name="info">The <see cref="SerializationInfo"/> class that contains the serialized data.</param>
        /// <param name="context">The <see cref="StreamingContext"/> that describes the serialization state.</param>
        protected ProxyObjectReference(SerializationInfo info, StreamingContext context)
        {
            // Deserialize the base type using its assembly qualified name
            string qualifiedName = info.GetString("__baseType");
            _baseType = Type.GetType(qualifiedName, true, false);

            // Rebuild the list of interfaces
            List<Type> interfaceList = new List<Type>();
            int interfaceCount = info.GetInt32("__baseInterfaceCount");
            for (int i = 0; i < interfaceCount; i++)
            {
                string keyName = string.Format("__baseInterface{0}", i);
                string currentQualifiedName = info.GetString(keyName);
                Type interfaceType = Type.GetType(currentQualifiedName, true, false);

                interfaceList.Add(interfaceType);
            }

            // Reconstruct the proxy
            ProxyFactory factory = new ProxyFactory();
            Type proxyType = factory.CreateProxyType(_baseType, interfaceList.ToArray());
            _proxy = (IProxy)Activator.CreateInstance(proxyType);

            IInterceptor interceptor = (IInterceptor)info.GetValue("__interceptor", typeof(IInterceptor));
            _proxy.Interceptor = interceptor;
        }
	protected MissingMemberException (SerializationInfo info, StreamingContext context)
		: base (info, context)
	{
		ClassName = info.GetString ("MMClassName");
		MemberName = info.GetString ("MMMemberName");
		Signature = (byte[]) info.GetValue ("MMSignature", typeof(byte[]));
	}
Example #9
0
 public RevokeRoleStatement(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Grantee = info.GetString("Grantee");
     RoleName = info.GetString("Role");
     Admin = info.GetBoolean("Admin");
 }
        public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
        {
            typeof(Point).GetField("X").SetValue(obj, info.GetString("X"));
            typeof(Point).GetField("Y").SetValue(obj, info.GetString("Y"));

            return null;
        }
Example #11
0
 protected ErrorDetails(SerializationInfo info, StreamingContext context)
 {
     this._message = "";
     this._recommendedAction = "";
     this._message = info.GetString("ErrorDetails_Message");
     this._recommendedAction = info.GetString("ErrorDetails_RecommendedAction");
 }
Example #12
0
	// FIXME: I made it private temporarily, later we can change it to internal (but not protected)
	private InternalLoggerException (SerializationInfo info, StreamingContext context)
		: base (info, context)
	{
		buildEventArgs = (BuildEventArgs) info.GetValue ("BuildEventArgs", typeof (BuildEventArgs));
		errorCode = info.GetString ("ErrorCode");
		helpKeyword = info.GetString ("HelpKeywordPrefix");
	}
 public QueueCacheMissException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Requested = info.GetString("Requested");
     Low = info.GetString("Low");
     High = info.GetString("High");
 }
 protected SerializationWrapper(SerializationInfo info, StreamingContext context)
 {
     var typeName = info.GetString("Type");
     _type = Type.GetType(typeName);
     var xml = info.GetString("Item");
     _item = SerializeHelper.Deserialize(_type, xml);
 }
Example #15
0
        protected StringData(SerializationInfo si, StreamingContext ctx)
        {
            //从流中得到合并的成员变量
            dataItemOne = si.GetString("First_Item").ToLower();
            dataItemTwo = si.GetString("Second_Item").ToLower();

        }
Example #16
0
 protected CacheNode(SerializationInfo info, StreamingContext context)
 {
     nodeId = info.GetString("nodeId");
     backupNodeId = info.GetString("backupNodeId");
     prevNodeId = info.GetString("prevNodeId");
     mySequence = info.GetInt32("mySequence");
 }
Example #17
0
	protected LoggerException (SerializationInfo info,
				   StreamingContext context)
		: base (info, context)
	{
		errorCode = info.GetString ("errorCode");
		helpKeyword = info.GetString ("helpKeyword");
	}
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericBusinessException"/> class.
 /// </summary>
 /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
 /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
 /// <exception cref="T:System.ArgumentNullException">The <paramref name="info"/> parameter is null. </exception>
 /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0). </exception>
 public GenericBusinessException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _data = (IDictionary)info.GetValue("_data", typeof(IDictionary));
     _stackTrace = info.GetString("_stackTrace");
     _type = info.GetString("_type");
 }
Example #19
0
        /// <summary>
        /// Serialization constructor required for <see cref="ISerializable"/>; reads connection data from <paramref name="info"/>.
        /// </summary>
        /// <param name="info">Serialization store that we are going to read our data from.</param>
        /// <param name="context">Streaming context to use during the deserialization process.</param>
        protected RdpConnection(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            Animations = info.GetBoolean("Animations");
            AudioMode = info.GetValue<AudioMode>("AudioMode");
            ColorDepth = info.GetInt32("ColorDepth");
            ConnectClipboard = info.GetBoolean("ConnectClipboard");
            ConnectDrives = info.GetBoolean("ConnectDrives");
            ConnectPrinters = info.GetBoolean("ConnectPrinters");
            DesktopBackground = info.GetBoolean("DesktopBackground");
            DesktopComposition = info.GetBoolean("DesktopComposition");
            DesktopHeight = info.GetInt32("DesktopHeight");
            DesktopWidth = info.GetInt32("DesktopWidth");
            FontSmoothing = info.GetBoolean("FontSmoothing");
            KeyboardMode = info.GetValue<KeyboardMode>("KeyboardMode");
            PersistentBitmapCaching = info.GetBoolean("PersistentBitmapCaching");
            RecordingMode = info.GetValue<RecordingMode>("RecordingMode");
            VisualStyles = info.GetBoolean("VisualStyles");
            WindowContentsWhileDragging = info.GetBoolean("WindowContentsWhileDragging");
            ConnectToAdminChannel = info.GetBoolean("ConnectToAdminChannel");

            UseTSProxy = info.GetBoolean("UseTSProxy");
            ProxyName = info.GetString("ProxyName");
            ProxyUserName = info.GetString("ProxyUserName");

            string encryptedProxyPassword = info.GetString("ProxyPassword");
            if (!String.IsNullOrEmpty(encryptedProxyPassword))
            {
                EncryptedPassword = encryptedProxyPassword;
            }
        }
 private OperationNotFoundException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _operationName = info.GetString("operationName");
     _className = info.GetString("className");
     _objectName = info.GetString("objectName");
 }
		MemberInfoSerializationHolder(SerializationInfo info, StreamingContext ctx)
		{
			string assemblyName;
			string typeName;

			assemblyName = info.GetString("AssemblyName");
			typeName = info.GetString("ClassName");

			_memberName = info.GetString("Name");
			_memberSignature = info.GetString("Signature");
			_memberType = (MemberTypes) info.GetInt32("MemberType");

#if NET_2_0
			try {
				_genericArguments = null;

				// FIXME: this doesn't work at present. It seems that
				// ObjectManager doesn't cope with nested IObjectReferences.
				// _genericArguments = (Type[]) info.GetValue("GenericArguments", typeof(Type[]));
			} catch (SerializationException) {
				// expected (old NET_1_0 protocol)
			}
#endif
			// Load type
			Assembly asm = Assembly.Load(assemblyName);

			_reflectedType = asm.GetType(typeName, true, true);
		}
 /// <devdoc>
 /// </devdoc>
 /// <internalonly/>
 private EventLogEntry(SerializationInfo info, StreamingContext context) {
     dataBuf = (byte[])info.GetValue("DataBuffer", typeof(byte[]));
     string logName = info.GetString("LogName");
     string machineName = info.GetString("MachineName");
     owner = new EventLogInternal(logName, machineName, "");
     GC.SuppressFinalize(this);
 }
        private FormCard(SerializationInfo info, StreamingContext context)
        {
            if (info == null)
                throw new ArgumentNullException("info");

            string strRecords = info.GetString("records");
            this.records = strRecords.BinaryDeserialize<FormRecordList>();
            foreach(FormRecord record in this.records)
            {
                record.OnDeserialization(this);
            }

            string strRelations = info.GetString("relations");
            this.relations = strRelations.BinaryDeserialize<TableRelationList>();
            if (this.relations.Count > 0)
            {
                FormRecord parentRecord = this.records.First();

                foreach (TableRelation rel in this.relations)
                {
                    DbKey parentKey = parentRecord.Keys[rel.ParentFK];

                    parentKey.PropertyChanged -= this.OnParentKeyValueChanged;
                    parentKey.PropertyChanged += this.OnParentKeyValueChanged;
                }
            }
        }
Example #24
0
	public ServiceException( SerializationInfo info, StreamingContext context ) : base( info, context )
	{
		instancesCreated = info.GetInt32( "instancesCreated" );
		description = info.GetString( "description" );
		details = info.GetString( "details" );
		code = info.GetInt32( "code" );
	}
 protected ShaderException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     ShaderLog = info.GetString("ShaderLog");
     ShaderSource = info.GetString("ShaderSource");
     ShaderType = (ShaderType)info.GetInt32("ShaderType");
 }
	protected FileNotFoundException(SerializationInfo info,
									StreamingContext context)
			: base(info, context)
			{
				fileName = info.GetString("FileNotFound_FileName");
				fusionLog = info.GetString("FileNotFound_FusionLog");
			}
Example #27
0
 public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
 {
     Utility.SetFieldValue(ref obj, "_baseUrl", Utility.PrivateInstance, info.GetString("baseUrl"));
     Utility.SetFieldValue(ref obj, "_token", Utility.PrivateInstance, info.GetString("token"));
     Utility.SetFieldValue(ref obj, "_mapType", Utility.PrivateInstance, info.GetChar("mapType"));
     return obj;
 }
Example #28
0
 private GrantRoleStatement(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     Role = info.GetString("Role");
     Grantee = info.GetString("Grantee");
     WithAdmin = info.GetBoolean("WithAdmin");
 }
 private NonUniquePriorityException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _failedMapper = info.GetString("newMapper");
      _existingMapper = info.GetString("existingMapper");
      _priority = info.GetInt32("priority");
 }
 internal UnitySerializationHolder(SerializationInfo info, StreamingContext context)
 {
     if (info == null)
     {
         throw new ArgumentNullException("info");
     }
     this.m_unityType = info.GetInt32("UnityType");
     if (this.m_unityType != 3)
     {
         if (this.m_unityType == 7)
         {
             this.m_declaringMethod = info.GetValue("DeclaringMethod", typeof(MethodBase)) as MethodBase;
             this.m_declaringType = info.GetValue("DeclaringType", typeof(Type)) as Type;
             this.m_genericParameterPosition = info.GetInt32("GenericParameterPosition");
             this.m_elementTypes = info.GetValue("ElementTypes", typeof(int[])) as int[];
         }
         else
         {
             if (this.m_unityType == 8)
             {
                 this.m_instantiation = info.GetValue("GenericArguments", typeof(Type[])) as Type[];
                 this.m_elementTypes = info.GetValue("ElementTypes", typeof(int[])) as int[];
             }
             this.m_data = info.GetString("Data");
             this.m_assemblyName = info.GetString("AssemblyName");
         }
     }
 }