Beispiel #1
0
        private string ExtractInfo(ISharedInterface Item)
        {
            string Name = Item.GetType().Assembly.GetName().Name + " " + Item.ToString();
            var    CustomInfoCopyrightCall = g_Weather.GetType().Assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyCopyrightAttribute), false);

            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append(Name).Append(Environment.NewLine);
            sb.Append('_', Name.Length).Append(Environment.NewLine);
            if (CustomInfoCopyrightCall.Length > 0)
            {
                sb.Append("Copyright: ").Append(((System.Reflection.AssemblyCopyrightAttribute)CustomInfoCopyrightCall[0]).Copyright).Append(Environment.NewLine);
            }
            sb.Append("Version: ").Append(g_Weather.GetType().Assembly.GetName().Version.ToString()).Append(Environment.NewLine);
            sb.Append("Debug Info: ").Append(Item.Debug()).Append(Environment.NewLine).Append(Environment.NewLine);
            return(sb.ToString());
        }
Beispiel #2
0
        private string ExtractInfo(ISharedInterface Item)
        {
            string text = Item.GetType().Assembly.GetName().Name + " " + Item.ToString();

            object[]      customAttributes = g_Weather.GetType().Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), inherit: false);
            StringBuilder stringBuilder    = new StringBuilder();

            stringBuilder.Append(text).Append(Environment.NewLine);
            stringBuilder.Append('_', text.Length).Append(Environment.NewLine);
            if (customAttributes.Length != 0)
            {
                stringBuilder.Append("Copyright: ").Append(((AssemblyCopyrightAttribute)customAttributes[0]).Copyright).Append(Environment.NewLine);
            }
            stringBuilder.Append("Version: ").Append(g_Weather.GetType().Assembly.GetName().Version.ToString()).Append(Environment.NewLine);
            stringBuilder.Append("Debug Info: ").Append(Item.Debug()).Append(Environment.NewLine)
            .Append(Environment.NewLine);
            return(stringBuilder.ToString());
        }