FindAll() публичный статический Метод

Finds and builds an array of SccStamp instances from all the SccAttribute attributes applied to the given assembly.
public static FindAll ( Assembly assembly ) : Elmah.SccStamp[]
assembly System.Reflection.Assembly
Результат Elmah.SccStamp[]
Пример #1
0
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            //
            // Emit a script that emit version info and checks for updates.
            //

            writer.WriteLine(@"
                <script type='text/javascript' language='JavaScript'>
                    function onCheckForUpdate(sender) {
                        var script = document.createElement('script');
                        script.type = 'text/javascript';
                        script.language = 'JavaScript';
                        script.src = 'http://elmah.googlecode.com/svn/www/update.js?__=' + (new Date()).getTime();
                        document.getElementsByTagName('head')[0].appendChild(script);
                        return false;
                    }
                    var ELMAH = {
                        info : {
                            version     : '" + GetVersion() + @"',
                            fileVersion : '" + GetFileVersion() + @"',
                            type        : '" + Build.TypeLowercase + @"',
                            status      : '" + Build.Status + @"',
                            framework   : '" + Build.Framework + @"',
                            imageRuntime: '" + Build.ImageRuntimeVersion + @"'
                        }
                    };
                </script>");

            //
            // Title
            //

            writer.AddAttribute(HtmlTextWriterAttribute.Id, "PageTitle");
            writer.RenderBeginTag(HtmlTextWriterTag.H1);
            writer.Write(PageTitle);
            writer.RenderEndTag(); // </h1>
            writer.WriteLine();

            //
            // Speed Bar
            //

            SpeedBar.Render(writer,
                            SpeedBar.Home.Format(BasePageName),
                            SpeedBar.Help,
                            SpeedBar.About.Format(BasePageName));

            //
            // Content...
            //

            writer.RenderBeginTag(HtmlTextWriterTag.P);
            writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "return onCheckForUpdate(this)");
            writer.AddAttribute(HtmlTextWriterAttribute.Title, "Checks if your ELMAH version is up to date (requires Internet connection)");
            writer.RenderBeginTag(HtmlTextWriterTag.Button);
            writer.Write("Check for Update");
            writer.RenderEndTag(); // </button>
            writer.RenderEndTag(); // </p>

            SccStamp[] stamps = SccStamp.FindAll(typeof(ErrorLog).Assembly);
            SccStamp.SortByRevision(stamps, /* descending */ true);

            writer.RenderBeginTag(HtmlTextWriterTag.P);
            writer.Write("This <strong>{0}</strong> ", Build.TypeLowercase);

            if (stamps.Length > 0)
            {
                writer.Write("(SCC #{0}) ", stamps[0].Revision.ToString("N0"));
            }

            writer.Write("build was compiled from the following sources for CLR {0}:", Build.ImageRuntimeVersion);

            writer.RenderEndTag(); // </p>

            //
            // Stamps...
            //

            writer.RenderBeginTag(HtmlTextWriterTag.Ul);

            foreach (SccStamp stamp in stamps)
            {
                writer.RenderBeginTag(HtmlTextWriterTag.Li);
                writer.RenderBeginTag(HtmlTextWriterTag.Code);
                Server.HtmlEncode(stamp.Id, writer);
                writer.RenderEndTag(); // </code>
                writer.RenderEndTag(); // </li>
            }

            writer.RenderEndTag(); // </ul>
        }
Пример #2
0
        public override void Execute()
        {
            WriteLiteral("\r\n");



            #line 6 "..\..\AboutPage.cshtml"

            var basePageName = Request.ServerVariables["URL"];

            const string title = "About ELMAH";
            Layout = new Elmah.MasterPage
            {
                Context       = Context, /* TODO Consider not requiring this */
                Title         = title,
                SpeedBarItems = new[]
                {
                    SpeedBar.Home.Format(basePageName),
                    SpeedBar.Help,
                    SpeedBar.About.Format(basePageName),
                },
            };

            var stamps = SccStamp.FindAll(typeof(ErrorLog).Assembly)
                         .OrderByDescending(s => s.Revision)
                         .ToArray();



            #line default
            #line hidden


            WriteLiteral(@"

<script type='text/javascript' language='JavaScript'>
    function onCheckForUpdate(sender) {
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.language = 'JavaScript';
        script.src = 'https://elmah.github.io/update.js?__=' + (new Date()).getTime();
        document.getElementsByTagName('head')[0].appendChild(script);
        return false;
    }
    var ELMAH = {
        info: {
            version: '");



            #line 41 "..\..\AboutPage.cshtml"
            Write(GetVersion());


            #line default
            #line hidden
            WriteLiteral("\',\r\n            fileVersion: \'");



            #line 42 "..\..\AboutPage.cshtml"
            Write(GetFileVersion());


            #line default
            #line hidden
            WriteLiteral("\',\r\n            type: \'");



            #line 43 "..\..\AboutPage.cshtml"
            Write(Build.TypeLowercase);


            #line default
            #line hidden
            WriteLiteral("\',\r\n            status: \'");



            #line 44 "..\..\AboutPage.cshtml"
            Write(Build.Status);


            #line default
            #line hidden
            WriteLiteral("\',\r\n            framework: \'");



            #line 45 "..\..\AboutPage.cshtml"
            Write(Build.Framework);


            #line default
            #line hidden
            WriteLiteral("\',\r\n            imageRuntime: \'");



            #line 46 "..\..\AboutPage.cshtml"
            Write(Build.ImageRuntimeVersion);


            #line default
            #line hidden
            WriteLiteral("\'\r\n        }\r\n    };\r\n</script>\r\n\r\n<h1 id=\"PageTitle\">");



            #line 51 "..\..\AboutPage.cshtml"
            Write(title);


            #line default
            #line hidden
            WriteLiteral("</h1>\r\n\r\n<p>\r\n    <button class=\"btn\"\r\n        onclick=\"return onCheckForUpdate(t" +
                         "his)\"\r\n        title=\"Checks if your ELMAH version is up to date (requires Inter" +
                         "net connection)\">Check for Update</button>\r\n</p>\r\n\r\n<p>\r\n    This <strong>");



            #line 60 "..\..\AboutPage.cshtml"
            Write(Build.TypeLowercase);


            #line default
            #line hidden
            WriteLiteral("</strong>\r\n    ");



            #line 61 "..\..\AboutPage.cshtml"
            Write(stamps.Any() ? "(SCC #" + stamps.First().Revision.ToString("N0") + ")" : null);


            #line default
            #line hidden
            WriteLiteral("\r\n    build was compiled from the following sources for CLR ");



            #line 62 "..\..\AboutPage.cshtml"
            Write(Build.ImageRuntimeVersion);


            #line default
            #line hidden
            WriteLiteral(":\r\n</p>\r\n\r\n<ul>\r\n");



            #line 66 "..\..\AboutPage.cshtml"
            foreach (var stamp in stamps)
            {
            #line default
            #line hidden
                WriteLiteral("        <li><code>");



            #line 68 "..\..\AboutPage.cshtml"
                Write(stamp.Id);


            #line default
            #line hidden
                WriteLiteral("</code></li>        \r\n");



            #line 69 "..\..\AboutPage.cshtml"
            }


            #line default
            #line hidden
            WriteLiteral("</ul>\r\n");


            WriteLiteral("\r\n");
        }