Beispiel #1
0
        private static Type GetTypeWithStreamingOutputAttribute(StreamingOutputFormat format)
        {
            var attributeType = typeof(StreamingFormatAttribute);

            foreach (var type in Assembly.GetExecutingAssembly().GetTypes())
            {
                if (!type.IsDefined(attributeType))
                {
                    continue;
                }
                var a = type.GetCustomAttribute <StreamingFormatAttribute>();

                if (a.OutputFormat == format)
                {
                    return(type);
                }
            }

            return(null);
        }
Beispiel #2
0
 public StreamingFormatAttribute(StreamingOutputFormat outputFormat)
 {
     _outputFormat = outputFormat;
 }