This file contains 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 SolutionCleaner | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
public class Program | |
{ | |
#region [ Private Fields ] | |
private static readonly List<string> FolderList = new List<string> { "bin", "obj", "TestResults", "packages" }; |
This file contains 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 PerWebRequestLifestyleOverrider : IContributeComponentModelConstruction | |
{ | |
public void ProcessModel(IKernel kernel, ComponentModel model) | |
{ | |
if (model.LifestyleType == LifestyleType.PerWebRequest) | |
{ | |
model.LifestyleType = LifestyleType.Singleton; | |
} | |
} | |
} |
This file contains 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
var conatiner = new WindsorContainer(); | |
container.Kernel.ComponentModelBuilder.AddContributor(new PerWebRequestLifestyleOverrider()); | |
// Rest of your code |
This file contains 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.Collections.Generic; | |
using System.Linq; | |
using Microsoft.Build.Evaluation; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var projectList = new List<string>() | |
{ |
This file contains 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
[DebuggerDisplay("Name of employee is {FirstName} {Surname} and his department is {Department}")] | |
public class Employee | |
{ | |
public string FirstName { get; set; } | |
public string Surname { get; set; } | |
public string Department { get; set; } | |
} |
This file contains 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 Employee | |
{ | |
[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)] | |
public string FirstName { get; set; } | |
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | |
public string Surname { get; set; } | |
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] |
This file contains 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.Diagnostics; | |
using System.Runtime.CompilerServices; | |
namespace CallerInfoExample | |
{ | |
public static class Logger | |
{ | |
public static void Log(string message, | |
[CallerFilePath] string sourceFilePath = "", | |
[CallerLineNumber] int sourceLineNumber = 0, |
This file contains 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 Logger | |
{ | |
public static void Log(string message, | |
[CallerFilePath] string sourceFilePath = "", | |
[CallerLineNumber] int sourceLineNumber = 0, | |
[CallerMemberName] string callerMemberName = "") | |
{ | |
Log($"[Message]: {message}; [Source File Path]: {sourceFilePath}; " + | |
$"[Source Line Number]: {sourceLineNumber}; [Caller Member Name]: {callerMemberName}; "); | |
} |
This file contains 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; | |
namespace GetUnicodeCategoryExample | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var sampleString = @"1aB%$^()-"; | |
for (int i = 0; i < sampleString.Length; i++) |
This file contains 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.Diagnostics; | |
using System.Runtime.CompilerServices; | |
namespace ConditionalAttributeExample | |
{ | |
public static class Logger | |
{ | |
public static void Log(string message, | |
[CallerFilePath] string sourceFilePath = "", | |
[CallerLineNumber] int sourceLineNumber = 0, |
OlderNewer