public static object GetObjectByName( [NotNull] this SqlDataReader reader, [NotNull] string column, [CanBeNull] object nullValue = null, [CanBeNull] object context = null, StreamingContextStates contextState = StreamingContextStates.Other) { if (reader == null) throw new ArgumentNullException("reader"); if (column == null) throw new ArgumentNullException("column"); int ordinal = reader.GetOrdinal(column); if (reader.IsDBNull(ordinal)) return nullValue; SqlBytes bytes = reader.GetSqlBytes(ordinal); using (Stream serializationStream = bytes.Stream) { Debug.Assert(serializationStream != null); return Serialize.GetFormatter(context, contextState).Deserialize(serializationStream); } }
internal StreamingContext(StreamingContextStates state, Object additional) { m_state = state; m_additionalContext = additional; }
internal StreamingContext(StreamingContextStates state) : this(state, null) { }
public StreamingContext (StreamingContextStates state) { this.state = state; additional = null; }
/// <summary> /// Creates a StreamingContext with a CommandSerializationContext as its user context /// </summary> public static StreamingContext ToStreamingContext( StreamingContextStates state, CommandUserRegistry userRegistry, CommandRegistry commandRegistry ) { CommandSerializationContext userContext = new CommandSerializationContext( userRegistry, commandRegistry ); StreamingContext context = new StreamingContext( state, userContext ); return context; }
private NotProperImplementedSerializableClass(SerializationInfo info, StreamingContext context) // Noncompliant, because using the serialization info is required for properly implementing the serializable constructor. { state = context.State; }
// // Summary: // Initializes a new instance of the System.Runtime.Serialization.StreamingContext // class with a given context state. // // Parameters: // state: // A bitwise combination of the System.Runtime.Serialization.StreamingContextStates // values that specify the source or destination context for this System.Runtime.Serialization.StreamingContext. public StreamingContext(StreamingContextStates state) { m_States = state; }
public StreamingContext(StreamingContextStates state, object additional) { }
public StreamingContext(StreamingContextStates state) { throw new NotSupportedException(); }
public StreamingContext(StreamingContextStates state, object context) { State = state; Context = context; }
// Constructors public StreamingContext(StreamingContextStates state) { }
public StreamingContext(StreamingContextStates state, object additional) { this.state = state; this.additional = additional; }
public StreamingContext(StreamingContextStates state) { this.state = state; additional = null; }
public StreamingContext(StreamingContextStates state) : this(state, null) { }
public StreamingContext(StreamingContextStates state, object additional) { throw new NotSupportedException(); }
public StreamingContext(StreamingContextStates state, object additional) { this.m_state = state; this.m_additionalContext = additional; }
public StreamingContext(StreamingContextStates state, object?additional) { _state = state; _additionalContext = additional; }