public void GetStreamingSourceType_from_known_produces_correct_type(KnownStreamingSource ks, Type expected) { Assert.Equal( expected, StreamingSource.GetStreamingSourceType(ks) ); Assert.IsInstanceOf( expected, StreamingSource.Create(ks) ); }
public static Type GetStreamingSourceType(KnownStreamingSource knownStreamingSource) { switch (knownStreamingSource) { case KnownStreamingSource.XmlFormatter: return(typeof(XmlFormatterStreamingSource)); case KnownStreamingSource.Properties: return(typeof(PropertiesStreamingSource)); case KnownStreamingSource.Text: return(typeof(TextStreamingSource)); default: return(null); } }
public static Type GetStreamingSourceType(KnownStreamingSource knownStreamingSource) { switch (knownStreamingSource) { case KnownStreamingSource.BinaryFormatter: return typeof(BinaryFormatterStreamingSource); case KnownStreamingSource.XmlFormatter: return typeof(XmlFormatterStreamingSource); case KnownStreamingSource.Properties: return typeof(PropertiesStreamingSource); case KnownStreamingSource.Text: return typeof(TextStreamingSource); default: return null; } }
public static StreamingSource Create(KnownStreamingSource knownSource) { return (StreamingSource) Activator.CreateInstance(GetStreamingSourceType(knownSource)); }
public static StreamingSource Create(KnownStreamingSource knownSource) { return((StreamingSource)Activator.CreateInstance(GetStreamingSourceType(knownSource))); }
public StreamingSourceAttribute(KnownStreamingSource knownStreamingSource) : base(StreamingSource.GetStreamingSourceType(knownStreamingSource)) { }
public DefineStreamingSourceAttribute(Type adapteeType, KnownStreamingSource knownStreamingSource) : base(AdapterRole.StreamingSource, adapteeType, StreamingSource.GetStreamingSourceType(knownStreamingSource)) { }
public StreamingSourceAttribute(KnownStreamingSource knownStreamingSource) : base(StreamingSource.GetStreamingSourceType(knownStreamingSource), AdapterRole.StreamingSource) { }