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
| //ispired from http://frankmao.com/2010/11/19/when-caliburn-micro-meets-avalondock/ | |
| public class TabModel:Screen | |
| { | |
| protected override void OnActivate() | |
| { | |
| base.OnActivate(); | |
| } | |
| protected override void OnDeactivate(bool close) | |
| { | |
| base.OnDeactivate(close); |
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
| <html xmlns:v="urn:schemas-microsoft-com:vml" | |
| xmlns:o="urn:schemas-microsoft-com:office:office" | |
| xmlns:w="urn:schemas-microsoft-com:office:word" | |
| xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" | |
| xmlns="http://www.w3.org/TR/REC-html40"> | |
| <head> | |
| <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> | |
| <meta name=ProgId content=Word.Document> | |
| <meta name=Generator content="Microsoft Word 12"> |
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 ContactFetcher | |
| { | |
| public event EventHandler<ContactFetchEventArgs> ContactFetch = delegate { }; | |
| public void BeginFetchAll(string user, string password) | |
| { | |
| ContactsService svc = new ContactsService("MyApp"); | |
| svc.setUserCredentials(user, password); | |
| List<ContactEntry> contacts = new List<ContactEntry>(); |
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 interface IContract<T> | |
| { | |
| IContract<T> Is<TT>(); | |
| IContract<T> IsEqual<TT>(TT of) where TT : T,IEquatable<TT>; | |
| IContract<T> IsGreatherThan<TT>(TT of) where TT : T,IComparable; | |
| IContract<T> IsGreatherThanOrEqual<TT>(TT of) where TT :T, IComparable; | |
| IContract<T> IsLessThan<TT>(TT of) where TT : T,IComparable; | |
| IContract<T> IsLessThanOrEq<TT>(TT of) where TT : T,IComparable; | |
| IContract<T> IsNot<TT>(); | |
| IContract<T> IsNotEqual<TT>(TT of) where TT : T,IEquatable<TT>; |
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
| static class PredicateRewriter | |
| { | |
| public static Expression<Predicate<T>> Rewrite<T>(Expression<Predicate<T>> exp | |
| , string newParamName) | |
| { | |
| var param = Expression.Parameter(exp.Parameters[0].Type, newParamName); | |
| var newExpression = new PredicateRewriterVisitor(param).Visit(exp); | |
| return (Expression<Predicate<T>>)newExpression; | |
| } |
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 Haversine | |
| { | |
| private static double ToRadiant(this double ang) | |
| { | |
| return ang * Math.PI / 180.0; | |
| } | |
| private static double ToDeg(this double ang) | |
| { | |
| return ang / Math.PI * 180.0; | |
| } |
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 RouteResolver | |
| { | |
| string language = "en-GB"; | |
| public RouteResolver() | |
| { | |
| } | |
| public RouteResolver(string language) | |
| { |
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 AddressResolver | |
| { | |
| string language = "en-GB"; | |
| public AddressResolver() | |
| { | |
| } | |
| public AddressResolver(string language) | |
| { | |
| this.language = language; |
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 SwapperTest | |
| { | |
| public class Test_ | |
| { | |
| public int X { get; set; } | |
| public int Y { get; set; } | |
| } | |
| [TestMethod] |
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
| class PropertyChangeBase : INotifyPropertyChanged | |
| { | |
| protected void SignalChanged<T>(Expression<Func<T>> exp) | |
| { | |
| if (exp.Body.NodeType == ExpressionType.MemberAccess) | |
| { | |
| var name = (exp.Body as MemberExpression).Member.Name; | |
| PropertyChanged(this, new PropertyChangedEventArgs(name)); | |
| } | |
| else |
OlderNewer