Example #1
0
 /// <summary>
 /// Initializes a new instance of the PSArgumentException class
 /// using data serialized via
 /// <see cref="System.Runtime.Serialization.ISerializable"/>
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 /// <returns> constructed object </returns>
 protected PSArgumentException(SerializationInfo info,
                    StreamingContext context)
         : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
     _message = info.GetString("PSArgumentException_MessageOverride");
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="MailChimpException"/> class.
        /// </summary>
        /// <param name="info">
        /// The info.
        /// </param>
        /// <param name="context">
        /// The context.
        /// </param>
        /// <exception cref="ArgumentNullException"><paramref>
        ///         <name>name</name>
        ///     </paramref>
        ///     is null. </exception>
        /// <exception cref="InvalidCastException">The value associated with <paramref>
        ///         <name>name</name>
        ///     </paramref>
        ///     cannot be converted to a <see cref="T:System.String" />. </exception>
        /// <exception cref="SerializationException">An element with the specified name is not found in the current instance. </exception>
        // ReSharper disable once UnusedParameter.Local
        public MailChimpException(SerializationInfo info, StreamingContext context)
        {
            var errorText = string.Empty;

            try
            {
                this.Detail   = info?.GetString("detail");
                this.Title    = info?.GetString("title");
                this.Type     = info?.GetString("type");
                this.Status   = info?.GetInt32("status") ?? 0;
                this.Instance = info?.GetString("instance");

                errorText =
                    $"Title: {this.Title + Environment.NewLine} Type: {this.Type + Environment.NewLine} Status: {this.Status + Environment.NewLine} + Detail: {this.Detail + Environment.NewLine}";
                this.Errors = (List <Error>)info?.GetValue("errors", typeof(List <Error>));
                errorText  += "Errors: " + string.Join(" : ", this.Errors.Select(x => x.Field + " " + x.Message));
            }
            catch
            {
                // ignored
            }
            finally
            {
                Trace.Write(errorText);
                Debug.Write(errorText);
            }
        }
 /// <summary>
 /// Restore state.
 /// </summary>
 public YahooStockDataSource(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _filesFolder = info.GetString("filesFolder");
     _yahooStockSymbolsFileName = info.GetString("yahooStockSymbolsFileName");
     _dataSourceStub = (DataSourceStub)info.GetValue("dataSourceStub", typeof(DataSourceStub));
     _dataSourceStub.Initialize(this);
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MailChimpException"/> class.
 /// </summary>
 /// <param name="info">
 /// The info.
 /// </param>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <exception cref="ArgumentNullException"><paramref>
 ///         <name>name</name>
 ///     </paramref>
 ///     is null. </exception>
 /// <exception cref="InvalidCastException">The value associated with <paramref>
 ///         <name>name</name>
 ///     </paramref>
 ///     cannot be converted to a <see cref="T:System.String" />. </exception>
 /// <exception cref="SerializationException">An element with the specified name is not found in the current instance. </exception>
 // ReSharper disable once UnusedParameter.Local
 public MailChimpException(SerializationInfo info, StreamingContext context)
 {
     this.Detail   = info?.GetString("detail");
     this.Title    = info?.GetString("title");
     this.Type     = info?.GetString("type");
     this.Status   = info?.GetInt32("status") ?? 0;
     this.Instance = info?.GetString("instance");
 }
 public AuthenticationInfo(SerializationInfo info, StreamingContext context)
 {
     IsAuthenticated = info.GetBoolean("IsAuthenticated");
     UserId = info.GetString("UserId");
     UserAlias = info.GetString("UserAlias");
     UserName = info.GetString("UserName");
     Token = info.GetString("Token");
     TokenSecret = info.GetString("TokenSecret");
 }
		/// <summary>
		/// Constructor used for deserialization of the exception class.
		/// </summary>
		/// <param name="info">Represents the SerializationInfo of the exception.</param>
		/// <param name="context">Represents the context information of the exception.</param>
		protected BaseApplicationException(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			machineName = info.GetString("machineName");
			createdDateTime = info.GetDateTime("createdDateTime");
			appDomainName = info.GetString("appDomainName");
			threadIdentity = info.GetString("threadIdentity");
			windowsIdentity = info.GetString("windowsIdentity");
			additionalInformation = (NameValueCollection)info.GetValue("additionalInformation",typeof(NameValueCollection));
		}
Example #7
0
        /// <inheritdoc/>
        protected Xunit1TestCase(SerializationInfo info, StreamingContext context)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(
                info.GetString("AssemblyFileName"),
                info.GetString("TypeName"),
                info.GetString("MethodName")
            );

            DisplayName = info.GetString("DisplayName");
            SkipReason = info.GetString("SkipReason");
            SourceInformation = info.GetValue<SourceInformation>("SourceInformation");
            Traits = info.GetValue<IDictionary<string, string>>("Traits");
        }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MailChimpException"/> class.
 /// </summary>
 /// <param name="info">
 /// The info.
 /// </param>
 /// <param name="context">
 /// The context.
 /// </param>
 /// <exception cref="ArgumentNullException"><paramref>
 ///         <name>name</name>
 ///     </paramref>
 ///     is null. </exception>
 /// <exception cref="InvalidCastException">The value associated with <paramref>
 ///         <name>name</name>
 ///     </paramref>
 ///     cannot be converted to a <see cref="T:System.String" />. </exception>
 /// <exception cref="SerializationException">An element with the specified name is not found in the current instance. </exception>
 // ReSharper disable once UnusedParameter.Local
 public MailChimpException(SerializationInfo info, StreamingContext context)
 {
     try
     {
         this.Detail   = info?.GetString("detail");
         this.Title    = info?.GetString("title");
         this.Type     = info?.GetString("type");
         this.Status   = info?.GetInt32("status") ?? 0;
         this.Instance = info?.GetString("instance");
         this.Errors   = (List <Error>)info?.GetValue("errors", typeof(List <Error>));
     }
     catch
     { }
 }
 // Constructor for deserialization - should be used by serializer
 public Drawing(SerializationInfo info, StreamingContext ctxt)
 {
     name = info.GetString("Name");
     author = info.GetString("Author");
     timestamp = (DateTime)info.GetValue("Timestamp", typeof(DateTime));
     item = info.GetString("Item");
     byte[] bgBytes = (byte[])info.GetValue("Background", typeof(byte[]));
     backgroundA = bgBytes[0];
     backgroundR = bgBytes[1];
     backgroundG = bgBytes[2];
     backgroundB = bgBytes[3];
     strokes = (List<SampledStroke>)info.GetValue("Strokes", typeof(List<SampledStroke>));
     readOnly = true;
 }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the RuntimeException class
 /// using data serialized via
 /// <see cref="ISerializable"/>
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 /// <returns> constructed object </returns>
 protected RuntimeException(SerializationInfo info,
                    StreamingContext context)
         : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
     _errorCategory = (ErrorCategory)info.GetInt32("ErrorCategory");
 }
	protected ConfigurationException(SerializationInfo info,
									 StreamingContext context)
			: base(info, context)
			{
				HResult = unchecked((int)0x80131902);
				this.filename = info.GetString("filename");
				this.line = info.GetInt32("line");
			}
Example #12
0
        /// <inheritdoc/>
        protected Xunit1TestCase(SerializationInfo info, StreamingContext context)
        {
            reflectionWrapper = new Xunit1ReflectionWrapper(
                info.GetString("AssemblyFileName"),
                info.GetString("TypeName"),
                info.GetString("MethodName")
            );

            DisplayName = info.GetString("DisplayName");
            SkipReason = info.GetString("SkipReason");
            SourceInformation = info.GetValue<SourceInformation>("SourceInformation");

            Traits = new Dictionary<string, List<string>>(StringComparer.OrdinalIgnoreCase);
            var keys = info.GetValue<List<string>>("Traits.Keys");
            foreach (var key in keys)
                Traits.Add(key, info.GetValue<List<string>>(String.Format("Traits[{0}]", key)));
        }
 protected Uri(SerializationInfo serializationInfo, StreamingContext streamingContext)
 {
     string uri = serializationInfo.GetString("AbsoluteUri");
     if (uri.Length != 0)
     {
         this.CreateThis(uri, false, UriKind.Absolute);
     }
     else
     {
         uri = serializationInfo.GetString("RelativeUri");
         if (uri == null)
         {
             throw new ArgumentNullException("uriString");
         }
         this.CreateThis(uri, false, UriKind.Relative);
     }
 }
 protected ConfigurationErrorsException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     string filename = info.GetString("firstFilename");
     int line = info.GetInt32("firstLine");
     this.Init(filename, line);
     int num2 = info.GetInt32("count");
     if (num2 != 0)
     {
         this._errors = new ConfigurationException[num2];
         for (int i = 0; i < num2; i++)
         {
             string str2 = i.ToString(CultureInfo.InvariantCulture);
             Type type = Type.GetType(info.GetString(str2 + "_errors_type"), true);
             if ((type != typeof(ConfigurationException)) && (type != typeof(ConfigurationErrorsException)))
             {
                 throw ExceptionUtil.UnexpectedError("ConfigurationErrorsException");
             }
             this._errors[i] = (ConfigurationException) info.GetValue(str2 + "_errors", type);
         }
     }
 }
Example #15
0
		/// <exclude/>
		public UserOption(SerializationInfo serializationInfo, StreamingContext streamingContext)
			: base()
		{
			try
			{
				using (Slyce.Common.SerializationReader reader = new SerializationReader((byte[])serializationInfo.GetValue("d", typeof(byte[]))))
				{
					_name = reader.ReadString();
					_dataType = (Type)reader.ReadObject();
					_value = reader.ReadObject();
				}
			}
			catch
			{
				this._name = serializationInfo.GetString("_name");
				this._dataType = (Type)serializationInfo.GetValue("_dataType", typeof(Type));
				this._value = serializationInfo.GetValue("_value", typeof(object));
			}
		}
 private HttpCompileException(SerializationInfo info, StreamingContext context)
    :base(info, context) {
    _results = (CompilerResults) info.GetValue("_results", typeof(CompilerResults));
    _sourceCode = info.GetString("_sourceCode");
 }
Example #17
0
		/// <summary>
		/// Initializes a new instance of the PhpException class with serialized data. This constructor is used
		/// when an exception is thrown in a remotely called method. Such an exceptions needs to be serialized,
		/// transferred back to the caller and then rethrown using this constructor.
		/// </summary>
		/// <param name="info">The SerializationInfo that holds the serialized object data about the exception 
		/// being thrown.</param>
		/// <param name="context">The StreamingContext that contains contextual information about the source or 
		/// destination.</param>
		protected PhpException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
			this.error = (PhpError)info.GetValue("error", typeof(PhpError));
			this.info = new ErrorStackInfo(
			  (string)info.GetString("file"),
              (string)info.GetString("caller"),
              (int)info.GetInt32("line"),
			  (int)info.GetInt32("column"),
			  (bool)info.GetBoolean("libraryCaller"));
		}
Example #18
0
 protected AgentyException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     Status = info.GetString("Status");
     Code   = (int?)info.GetValue("Code", typeof(int?));
     Name   = info.GetString("Name");
 }
        // Serialization methods
        protected ConfigurationErrorsException(SerializationInfo info, StreamingContext context) : 
                base(info, context) { 

            string  firstFilename;
            int     firstLine;
            int     count;
            string  numPrefix;
            string  currentType;
            Type    currentExceptionType;

            // Retrieve out members
            firstFilename = info.GetString(SERIALIZATION_PARAM_FILENAME);
            firstLine     = info.GetInt32(SERIALIZATION_PARAM_LINE);
            
            Init(firstFilename, firstLine);

            // Retrieve errors for _errors object
            count = info.GetInt32(SERIALIZATION_PARAM_ERROR_COUNT);
            
            if (count != 0) {
                _errors = new ConfigurationException[count];
                
                for (int i = 0; i < count; i++) {
                    numPrefix = i.ToString(CultureInfo.InvariantCulture);

                    currentType = info.GetString(numPrefix + SERIALIZATION_PARAM_ERROR_TYPE);
                    currentExceptionType = Type.GetType(currentType, true);

                    // Only allow our exception types
                    if ( ( currentExceptionType != typeof( ConfigurationException ) ) &&
                         ( currentExceptionType != typeof( ConfigurationErrorsException ) ) ) {
                        throw ExceptionUtil.UnexpectedError( "ConfigurationErrorsException" );
                    }

                    _errors[i] = (ConfigurationException) 
                                    info.GetValue(numPrefix + SERIALIZATION_PARAM_ERROR_DATA,
                                                  currentExceptionType);
                }
            }
        }
 private TestDiagnostic(SerializationInfo info, StreamingContext context)
 {
     var id = info.GetString("id");
     _kind = info.GetString("kind");
     _message = info.GetString("message");
     _location = (Location)info.GetValue("location", typeof(Location));
     _severity = (DiagnosticSeverity)info.GetValue("severity", typeof(DiagnosticSeverity));
     var defaultSeverity = (DiagnosticSeverity)info.GetValue("defaultSeverity", typeof(DiagnosticSeverity));
     _arguments = (object[])info.GetValue("arguments", typeof(object[]));
     _descriptor = new DiagnosticDescriptor(id, string.Empty, _message, id, defaultSeverity, isEnabledByDefault: true);
 }
Example #21
0
 protected override void GetProperties(SerializationInfo info, IDictionary <string, object> properties)
 {
     base.GetProperties(info, properties);
     properties[nameof(ItemAlreadyExistsException.ItemPath)] = info.GetString(nameof(ItemAlreadyExistsException.ItemPath));
 }
Example #22
0
 protected ClientConfig(SerializationInfo info, StreamingContext context)
 {
     this.Ip       = info.GetString("Ip");
     this.Port     = info.GetInt32("Port");
     this.ServerIp = info.GetString("ServerIp");
 }
Example #23
0
 internal AvermentException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     m_From = info.GetString(FROM_FLD_NAME);
 }
Example #24
0
 /// <summary>
 /// Initializes a new instance of the PSObjectDisposedException class
 /// using data serialized via
 /// <see cref="System.Runtime.Serialization.ISerializable"/>
 /// </summary>
 /// <param name="info">serialization information.</param>
 /// <param name="context">streaming context.</param>
 /// <returns>Constructed object.</returns>
 protected PSObjectDisposedException(SerializationInfo info,
                                     StreamingContext context)
     : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MappingException"/> 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>
 public MappingException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     EntityTypeName = info.GetString("EntityTypeName");
 }
Example #26
0
 /// <summary>
 /// Constructor for binary deserialization
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 public DataObject(SerializationInfo info, StreamingContext context)
 {
     Name = info.GetString(nameof(Name));
 }
Example #27
0
        // When leaving a context we serialize out our ID as a name
        // rather than a raw ID.  When we enter a new context we
        // consult it's FieldTable to get the ID of the symbol name in
        // the new context.

        private SymbolId(SerializationInfo info, StreamingContext context)
        {
            ContractUtils.RequiresNotNull(info, "info");

            _id = SymbolTable.StringToId(info.GetString("symbolName"))._id;
        }
Example #28
0
 protected HDInsightClusterDoesNotExistException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     this.dnsName = info.GetString(DnsNameSerializationKey);
 }
 /// <summary>
 /// Initializes a new instance of the PSInvalidOperationException class
 /// using data serialized via
 /// <see cref="System.Runtime.Serialization.ISerializable"/>
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 /// <returns> constructed object </returns>
 protected PSInvalidOperationException(SerializationInfo info,
                    StreamingContext context)
         : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
 }
Example #30
0
 protected override NitroxTechType SetObjectData(NitroxTechType techType, SerializationInfo info)
 {
     techType.Name = info.GetString("name");
     return(techType);
 }
Example #31
0
 public DebugAssertionException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     m_From = info.GetString(FROM_FLD_NAME);
 }
Example #32
0
 protected OptionException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _option = info.GetString("OptionName");
 }
Example #33
0
        /// <summary>
        /// Serialization constructor for class RestartComputerTimeoutException
        /// </summary>
        /// 
        /// <param name="info"> 
        /// serialization information 
        /// </param>
        /// 
        /// <param name="context"> 
        /// streaming context 
        /// </param>
        private RestartComputerTimeoutException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            if (info == null)
            {
                throw new PSArgumentNullException("info");
            }

            ComputerName = info.GetString("ComputerName");
            Timeout = info.GetInt32("Timeout");
        }
Example #34
0
 /// <summary>
 /// Initializes a new instance of PSInvalidCastException with serialization parameters
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 protected PSInvalidCastException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
 }
 /// <summary>
 /// Initializes a new instance of the PSArgumentOutOfRangeException class
 /// using data serialized via
 /// <see cref="System.Runtime.Serialization.ISerializable"/>
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 /// <returns> constructed object </returns>
 protected PSArgumentOutOfRangeException(SerializationInfo info,
                    StreamingContext context)
         : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
 }
Example #36
0
 protected InconsistentStateException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     this.StoredEtag  = info.GetString("StoredEtag");
     this.CurrentEtag = info.GetString("CurrentEtag");
 }
Example #37
0
        /// <summary>
        /// This constructor is required by serialization.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        /// <exception cref="ArgumentNullException">
        /// 1. info is null.
        /// </exception>
        protected PSRemotingTransportRedirectException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            if (info == null)
            {
                throw new PSArgumentNullException("info");
            }

            RedirectLocation = info.GetString("RedirectLocation");
        }
 protected RemoteFileDeletionFailedException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     this.FilePath = info.GetString(nameof(FilePath));
 }
 protected SourceInformation(SerializationInfo info, StreamingContext context)
 {
     FileName = info.GetString("FileName");
     LineNumber = (int?)info.GetValue("LineNumber", typeof(int?));
 }
Example #40
0
 internal PrivilegeNotHeldException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _privilegeName = info.GetString("PrivilegeName");
 }
        //      DeSerialize dataset properties
        private void DeserializeDataSetProperties(SerializationInfo info, StreamingContext context) {
            //DataSet basic properties
            dataSetName = info.GetString("DataSet.DataSetName");
            namespaceURI = info.GetString("DataSet.Namespace");
            _datasetPrefix = info.GetString("DataSet.Prefix");
            //DataSet runtime properties
            _caseSensitive = info.GetBoolean("DataSet.CaseSensitive");
            int lcid = (int)info.GetValue("DataSet.LocaleLCID", typeof(int));
            _culture = new CultureInfo(lcid);
            _cultureUserSet = true;
            enforceConstraints = info.GetBoolean("DataSet.EnforceConstraints");



            //ExtendedProperties
            extendedProperties = (PropertyCollection)info.GetValue("DataSet.ExtendedProperties", typeof(PropertyCollection));
        }
 private TypeInitializationException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _typeName = info.GetString("TypeName");
 }
 private void DeserializeDataSetProperties(SerializationInfo info, StreamingContext context)
 {
     this.dataSetName = info.GetString("DataSet.DataSetName");
     this.namespaceURI = info.GetString("DataSet.Namespace");
     this._datasetPrefix = info.GetString("DataSet.Prefix");
     this._caseSensitive = info.GetBoolean("DataSet.CaseSensitive");
     int culture = (int) info.GetValue("DataSet.LocaleLCID", typeof(int));
     this._culture = new CultureInfo(culture);
     this._cultureUserSet = true;
     this.enforceConstraints = info.GetBoolean("DataSet.EnforceConstraints");
     this.extendedProperties = (PropertyCollection) info.GetValue("DataSet.ExtendedProperties", typeof(PropertyCollection));
 }
Example #44
0
 protected AssertException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     UserMessage = info.GetString("UserMessage");
 }
Example #45
0
 protected ExceptionWithCustomFields(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     Name = info.GetString("Name");
     Age  = info.GetInt32("Age");
 }
Example #46
0
 public BuildProduct(SerializationInfo Info, StreamingContext Context)
 {
     Path          = Info.GetString("pa");
     Type          = (BuildProductType)Info.GetInt32("ty");
     IsPrecompiled = Info.GetBoolean("ip");
 }
Example #47
0
 protected SerMember(SerializationInfo info, StreamingContext context)
 {
     System.Console.WriteLine("SerMember.ctor(info, context)");
     text = info.GetString("text");
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LibraryLoadingException"/> class.
 /// </summary>
 /// <param name="info">The serialized information.</param>
 /// <param name="context">The streaming context.</param>
 protected LibraryLoadingException([NotNull] SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     LibraryName = info.GetString(nameof(LibraryName));
 }
		protected ConfigurationException (SerializationInfo info, StreamingContext context)
			: base (info, context)
		{
			filename = info.GetString ("filename");
			line = info.GetInt32 ("line");
		}
 protected RTRemoveDocument(SerializationInfo info, StreamingContext context)
 {
     this.document = info.GetString("document");
 }
Example #51
0
		protected KRecord( SerializationInfo info, StreamingContext context )
		{
			int count = (int)info.GetValue( "ColumnCount", typeof( int ) );
			_Columns = new object[count];

			for( int i = 0; i < count; i++ ) {
				string type = info.GetString( "ColumnType" + i );
				object value = type == "VOID" ? null : info.GetValue( "ColumnValue" + i, Type.GetType( type ) );
				_Columns[i] = value;
			}

			_Sealed = info.GetBoolean( "RecordSealed" );

			_SerializeSchema = info.GetBoolean( "SerializeSchema" );
			if( _SerializeSchema ) _Schema = (KSchema)info.GetValue( "Schema", typeof( KSchema ) );
		}
Example #52
0
 protected RuleActionEvaluationException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     RuleName = info.GetString("RuleName");
 }
		protected GlobalDefine( SerializationInfo info, StreamingContext context )
		{
			define = info.GetString( "define" );
			enabled = info.GetBoolean( "enabled" );
		}
Example #54
0
        public void op_GetObjectData_SerializationInfo_StreamingContext()
        {
            var info = new SerializationInfo(typeof(Token), new FormatterConverter());
            var context = new StreamingContext(StreamingContextStates.All);

            const string expected = "Example";

            (new Token(expected) as ISerializable).GetObjectData(info, context);

            var actual = info.GetString("_value");

            Assert.Equal(expected, actual);
        }
Example #55
0
        public void op_GetObjectData_SerializationInfo_StreamingContext()
        {
            var info = new SerializationInfo(typeof(EntityTag), new FormatterConverter());
            var context = new StreamingContext(StreamingContextStates.All);

            const string expected = _jigsawEtag;

            ISerializable value = (EntityTag)_jigsawEtag;

            value.GetObjectData(info, context);

            var actual = info.GetString("_value");

            Assert.Equal(expected, actual);
        }
Example #56
0
        /// <summary>
        /// This constructor is required by serialization.
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        /// <exception cref="ArgumentNullException">
        /// 1. info is null.
        /// </exception>
        protected PSRemotingTransportException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            if (info == null)
            {
                throw new PSArgumentNullException("info");
            }

            _errorCode = info.GetInt32("ErrorCode");
            _transportMessage = info.GetString("TransportMessage");
        }
 /// <summary>
 /// Initializes a new instance of the PSNotImplementedException class
 /// using data serialized via
 /// <see cref="System.Runtime.Serialization.ISerializable"/>
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 /// <returns> constructed object </returns>
 protected PSNotImplementedException(SerializationInfo info,
                                       StreamingContext context)
         : base(info, context)
 {
     _errorId = info.GetString("ErrorId");
 }
Example #58
0
 protected Pop3CommandException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     StatusText = info.GetString("StatusText");
 }
Example #59
0
 private CompressedFileInfo(SerializationInfo info, StreamingContext context)
     : this(info?.GetString(nameof(FullName)) ?? throw new ArgumentNullException(nameof(info)),
            info.GetBoolean(nameof(IsFile)),
            info.GetInt64(nameof(Length)))
 {
 }
Example #60
0
 public BuildProperty(SerializationInfo Info, StreamingContext Context)
 {
     Name  = Info.GetString("na");
     Value = Info.GetString("va");
 }