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
| //Discovering all method declarations in a given tree: | |
| IEnumerable<MethodDeclarationSyntax> methods = | |
| tree.Root | |
| .DescendentNodes() | |
| .OfType<MethodDeclarationSyntax>().ToList(); |
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 Customer GetCustomer(Guid customerID) | |
| { | |
| try | |
| { | |
| return CustomerDataAccess.GetCustomer(customerID); | |
| } | |
| catch (Exception ex) | |
| { | |
| Handle(ex); | |
| } |
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 Customer GetCustomer(Guid customerID) | |
| { | |
| try | |
| { | |
| return CustomerDataAccess.GetCustomer(customerID); | |
| } | |
| catch (Exception ex) | |
| { | |
| Handle(ex); | |
| } |
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 Customer GetCustomer(Guid customerID) | |
| { | |
| try | |
| { | |
| return CustomerDataAccess.GetCustomer(customerID); | |
| } | |
| catch (SomeSpecialException) | |
| { | |
| throw; | |
| } |
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 Customer GetCustomer(Guid customerID) | |
| { | |
| return CustomerDataAccess.GetCustomer(customerID); | |
| } |
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 Some.Imaginary.Macro.Library; | |
| public class Sample | |
| { | |
| prop public string Name; | |
| } |
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 Sample | |
| { | |
| private string _name; | |
| public string Name | |
| { | |
| get { return _name; } | |
| set { _name = value; } | |
| } | |
| } |
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 Some.Imaginary.Macro.Library; | |
| public class Sample | |
| { | |
| prop public string Name; | |
| } |
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 int DoSomething(int x, int y) | |
| { | |
| if (x > 0) | |
| return x; | |
| return y; | |
| } | |
| public static int DoSomethingLazily(Func<int> x, Func<int> y) | |
| { |
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
| fibs = 0 : 1 : zipWith (+) fibs (tail fibs) |