This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ConvertTo-CentralPackageManagement() { | |
| Write-Host 'Searching for package references' | |
| $packages = @{} | |
| $conditionalPackages = @{} | |
| foreach ($csproj in (Get-ChildItem -Include *.csproj, *.props -Recurse)) { | |
| $root = [xml]($csproj | Get-Content -Raw) | |
| foreach ($itemGroup in $root.Project.ItemGroup) { | |
| foreach ($packageReference in $itemGroup.PackageReference) { | |
| if ($packageReference.Include -and $packageReference.Version) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using ServiceReference1; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.ServiceModel; | |
| using System.Threading.Tasks; | |
| namespace SSRSSimple | |
| { | |
| class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AuthenticatingHandler<T> : DelegatingHandler where T : ISecurityTokenAccessor | |
| { | |
| private readonly Policy<HttpResponseMessage> _policy; | |
| private readonly T _securityTokenAccessor; | |
| private IAccessToken _accessToken; | |
| private AuthenticationHeaderValue _authenticationHeader; | |
| public AuthenticatingHandler(T securityTokenAccessor) | |
| { | |
| _securityTokenAccessor = securityTokenAccessor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| struct TestEnumerator<T> : IEnumerator<T> | |
| { | |
| ArraySegment<T> m_Segment; | |
| public TestEnumerator(ref ArraySegment<T> seg) | |
| { | |
| m_Segment = seg; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace Analogy | |
| { | |
| /// <summary> | |
| /// This example shows that a library that needs access to target .NET Standard 1.3 | |
| /// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET | |
| /// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library. | |
| /// </summary>INetCoreApp10 | |
| class Example1 | |
| { | |
| public void Net45Application(INetFramework45 platform) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| using System.Net.Security; | |
| using System.Net.Sockets; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using ICSharpCode.SharpZipLib.Zip.Compression; | |
| using ICSharpCode.SharpZipLib.Zip.Compression.Streams; | |
| using Microsoft.Extensions.Logging; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class Coroutine { | |
| public static void BeginExecute(IEnumerable<Promise> enumerable) { | |
| MoveNext(enumerable.GetEnumerator()); | |
| } | |
| static void MoveNext(IEnumerator<Promise> enumerator) { | |
| if (enumerator.MoveNext()) { | |
| var promise = enumerator.Current; | |
| promise.Current = promise.Task(); | |
| promise.Current._CallBack = () => MoveNext(enumerator); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.IO.MemoryMappedFiles; | |
| using System.Runtime.CompilerServices; | |
| using System.Threading.Tasks; | |
| namespace FileAnalyzer | |
| { | |
| public static unsafe class NativeRecord |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.IO.MemoryMappedFiles; | |
| namespace FileAnalyzer | |
| { | |
| public static unsafe class NativeRecord | |
| { | |
| private static readonly int[] DaysToMonth365 = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class DumperExtensions | |
| { | |
| public static string DumpToString(this object a, int maxDepth = 16, bool breakCircularRefs = false) | |
| { | |
| return new Dumper(a, maxDepth, breakCircularRefs).ToString(); | |
| } | |
| public static T DumpToConsole<T>(this T a, int maxDepth = 16, bool breakCircularRefs = false) | |
| { | |
| Console.Out.WriteLine(DumpToString(a, maxDepth, breakCircularRefs)); |
NewerOlder