|
1 | | -using System; |
| 1 | +// Copyright (c) .NET Foundation. All rights reserved. |
| 2 | +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. |
| 3 | + |
| 4 | +using System; |
2 | 5 | using System.Collections; |
3 | 6 | using System.Collections.Generic; |
4 | 7 | using System.IO; |
@@ -340,11 +343,11 @@ public override XmlWriter GetXmlWriter(EmbeddedItem manifestItem, XmlWriterSetti |
340 | 343 | private ITaskItem[] CreateEmbeddedResource(params IDictionary<string, string>[] files) => |
341 | 344 | files.Select(f => new TestTaskItem(f)).ToArray(); |
342 | 345 |
|
343 | | - private static IDictionary<string, string> CreateMetadata( |
344 | | - string targetPath, |
345 | | - string manifestResourceName = null, |
346 | | - string logicalName = null |
347 | | - ) => |
| 346 | + private static IDictionary<string, string> |
| 347 | + CreateMetadata( |
| 348 | + string targetPath, |
| 349 | + string manifestResourceName = null, |
| 350 | + string logicalName = null) => |
348 | 351 | new Dictionary<string, string> |
349 | 352 | { |
350 | 353 | ["TargetPath"] = targetPath, |
@@ -398,106 +401,19 @@ public void SetMetadata(string metadataName, string metadataValue) |
398 | 401 | } |
399 | 402 | } |
400 | 403 |
|
401 | | - private IDictionary<string, string>[] GetSampleIdentityEmbeddedMetadata() |
402 | | - { |
403 | | - return new[]{ |
404 | | - CreateMetadata(@"Areas\Identity\Views\_ViewImports.cshtml"), |
405 | | - CreateMetadata(@"Areas\Identity\Views\_ViewStart.cshtml"), |
406 | | - CreateMetadata(@"Areas\Identity\Views\Account\AccessDenied.cshtml"), |
407 | | - CreateMetadata(@"Areas\Identity\Views\Account\ConfirmEmail.cshtml"), |
408 | | - CreateMetadata(@"Areas\Identity\Views\Account\ExternalLogin.cshtml"), |
409 | | - CreateMetadata(@"Areas\Identity\Views\Account\ForgotPassword.cshtml"), |
410 | | - CreateMetadata(@"Areas\Identity\Views\Account\ForgotPasswordConfirmation.cshtml"), |
411 | | - CreateMetadata(@"Areas\Identity\Views\Account\Lockout.cshtml"), |
412 | | - CreateMetadata(@"Areas\Identity\Views\Account\Login.cshtml"), |
413 | | - CreateMetadata(@"Areas\Identity\Views\Account\LoginWith2fa.cshtml"), |
414 | | - CreateMetadata(@"Areas\Identity\Views\Account\LoginWithRecoveryCode.cshtml"), |
415 | | - CreateMetadata(@"Areas\Identity\Views\Account\Register.cshtml"), |
416 | | - CreateMetadata(@"Areas\Identity\Views\Account\ResetPassword.cshtml"), |
417 | | - CreateMetadata(@"Areas\Identity\Views\Account\ResetPasswordConfirmation.cshtml"), |
418 | | - CreateMetadata(@"Areas\Identity\Views\Account\SignedOut.cshtml"), |
419 | | - CreateMetadata(@"Areas\Identity\Views\Manage\ChangePassword.cshtml"), |
420 | | - CreateMetadata(@"Areas\Identity\Views\Manage\Disable2fa.cshtml"), |
421 | | - CreateMetadata(@"Areas\Identity\Views\Manage\EnableAuthenticator.cshtml"), |
422 | | - CreateMetadata(@"Areas\Identity\Views\Manage\ExternalLogins.cshtml"), |
423 | | - CreateMetadata(@"Areas\Identity\Views\Manage\GenerateRecoveryCodes.cshtml"), |
424 | | - CreateMetadata(@"Areas\Identity\Views\Manage\Index.cshtml"), |
425 | | - CreateMetadata(@"Areas\Identity\Views\Manage\ResetAuthenticator.cshtml"), |
426 | | - CreateMetadata(@"Areas\Identity\Views\Manage\SetPassword.cshtml"), |
427 | | - CreateMetadata(@"Areas\Identity\Views\Manage\TwoFactorAuthentication.cshtml"), |
428 | | - CreateMetadata(@"Areas\Identity\Views\Manage\_Layout.cshtml"), |
429 | | - CreateMetadata(@"Areas\Identity\Views\Manage\_ManageNav.cshtml"), |
430 | | - CreateMetadata(@"Areas\Identity\Views\Manage\_StatusMessage.cshtml"), |
431 | | - CreateMetadata(@"Areas\Identity\Views\Manage\_ViewImports.cshtml"), |
432 | | - CreateMetadata(@"Identity\css\site.css"), |
433 | | - CreateMetadata(@"Identity\css\site.min.css"), |
434 | | - CreateMetadata(@"Identity\images\banner1.svg"), |
435 | | - CreateMetadata(@"Identity\images\banner2.svg"), |
436 | | - CreateMetadata(@"Identity\images\banner3.svg"), |
437 | | - CreateMetadata(@"Identity\images\banner4.svg"), |
438 | | - CreateMetadata(@"Identity\js\site.js"), |
439 | | - CreateMetadata(@"Identity\js\site.min.js"), |
440 | | - CreateMetadata(@"Identity\lib\bootstrap\.bower.json"), |
441 | | - CreateMetadata(@"Identity\lib\bootstrap\LICENSE"), |
442 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\css\bootstrap-theme.css"), |
443 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\css\bootstrap-theme.css.map"), |
444 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\css\bootstrap-theme.min.css"), |
445 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\css\bootstrap-theme.min.css.map"), |
446 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\css\bootstrap.css"), |
447 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\css\bootstrap.css.map"), |
448 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\css\bootstrap.min.css"), |
449 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\css\bootstrap.min.css.map"), |
450 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\fonts\glyphicons-halflings-regular.eot"), |
451 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\fonts\glyphicons-halflings-regular.svg"), |
452 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\fonts\glyphicons-halflings-regular.ttf"), |
453 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\fonts\glyphicons-halflings-regular.woff"), |
454 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\fonts\glyphicons-halflings-regular.woff2"), |
455 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\js\bootstrap.js"), |
456 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\js\bootstrap.min.js"), |
457 | | - CreateMetadata(@"Identity\lib\bootstrap\dist\js\npm.js"), |
458 | | - CreateMetadata(@"Identity\lib\jquery\.bower.json"), |
459 | | - CreateMetadata(@"Identity\lib\jquery\LICENSE.txt"), |
460 | | - CreateMetadata(@"Identity\lib\jquery\dist\jquery.js"), |
461 | | - CreateMetadata(@"Identity\lib\jquery\dist\jquery.min.js"), |
462 | | - CreateMetadata(@"Identity\lib\jquery\dist\jquery.min.map"), |
463 | | - CreateMetadata(@"Identity\lib\jquery-validation\.bower.json"), |
464 | | - CreateMetadata(@"Identity\lib\jquery-validation\LICENSE.md"), |
465 | | - CreateMetadata(@"Identity\lib\jquery-validation\dist\additional-methods.js"), |
466 | | - CreateMetadata(@"Identity\lib\jquery-validation\dist\additional-methods.min.js"), |
467 | | - CreateMetadata(@"Identity\lib\jquery-validation\dist\jquery.validate.js"), |
468 | | - CreateMetadata(@"Identity\lib\jquery-validation\dist\jquery.validate.min.js"), |
469 | | - CreateMetadata(@"Identity\lib\jquery-validation-unobtrusive\.bower.json"), |
470 | | - CreateMetadata(@"Identity\lib\jquery-validation-unobtrusive\jquery.validate.unobtrusive.js"), |
471 | | - CreateMetadata(@"Identity\lib\jquery-validation-unobtrusive\jquery.validate.unobtrusive.min.js") |
472 | | - }; |
473 | | - } |
474 | | - } |
475 | | - |
476 | | - internal class ManifestComparer : IEqualityComparer<Manifest> |
477 | | - { |
478 | | - public static IEqualityComparer<Manifest> Instance { get; } = new ManifestComparer(); |
479 | | - |
480 | | - public bool Equals(Manifest x, Manifest y) |
481 | | - { |
482 | | - return x.Root.Equals(y.Root); |
483 | | - } |
484 | | - |
485 | | - public int GetHashCode(Manifest obj) |
| 404 | + private class ManifestComparer : IEqualityComparer<Manifest> |
486 | 405 | { |
487 | | - return obj.Root.GetHashCode(); |
488 | | - } |
489 | | - } |
| 406 | + public static IEqualityComparer<Manifest> Instance { get; } = new ManifestComparer(); |
490 | 407 |
|
491 | | - static class SetExtensions |
492 | | - { |
493 | | - public static Entry AddRange(this Entry source, params Entry[] elements) |
494 | | - { |
495 | | - foreach (var element in elements) |
| 408 | + public bool Equals(Manifest x, Manifest y) |
496 | 409 | { |
497 | | - source.Children.Add(element); |
| 410 | + return x.Root.Equals(y.Root); |
498 | 411 | } |
499 | 412 |
|
500 | | - return source; |
| 413 | + public int GetHashCode(Manifest obj) |
| 414 | + { |
| 415 | + return obj.Root.GetHashCode(); |
| 416 | + } |
501 | 417 | } |
502 | 418 | } |
503 | 419 | } |
0 commit comments