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
<Application x:Class="RealMef.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
StartupUri="MainWindow.xaml"> | |
<Application.Resources> | |
</Application.Resources> | |
</Application> |
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 interface IGenerator | |
{ | |
string Name { get; } | |
string Generate(); | |
} |
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
/// <summary> | |
/// Extension to the ILog interface to allow for richer Error messages. | |
/// Based on a discussion in the Caliburn.Micro discussion forum on Codeplex. | |
/// See <see cref="http://caliburnmicro.codeplex.com/discussions/261656"/>. | |
/// </summary> | |
public interface ILogExtended : ILog | |
{ | |
/// <summary> | |
/// Logs the message as error. | |
/// </summary> |
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
class CreatorLEDTelevision : ITelevisionCreator | |
{ | |
public Television CreateTelevision() | |
{ | |
return new LED(); | |
} | |
} | |
class CreatorLCDTelevision : ITelevisionCreator | |
{ | |
public Television CreateTelevision() |
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
class ObserverTest | |
{ | |
public void RunTest() | |
{ | |
var observerable = new TheObservable(); | |
var observer = new TheObserver(); | |
using (observerable.Subscribe(observer)) | |
{ | |
// do something to change the state of an observable |
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
class FirstBankOfSafety | |
{ | |
/// <summary> | |
/// The current balance in the account | |
/// </summary> | |
public double CurrentBalance { get; private set; } | |
/// <summary> | |
/// Deposit money into your bank account and return the new balance | |
/// </summary> |
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
module Jekyll | |
class LessConverter < Converter | |
safe true | |
priority :high | |
def setup | |
return if @setup | |
require 'less' | |
@setup = true | |
rescue LoadError |
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
<Application x:Class="HelloAutofac.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="clr-namespace:HelloAutofac"> | |
<Application.Resources> | |
<ResourceDictionary> | |
<ResourceDictionary.MergedDictionaries> | |
<ResourceDictionary> | |
<local:MyBootStrapper x:Key="bootstrapper" /> | |
</ResourceDictionary> |
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
class DebugLogger : ILog | |
{ | |
#region Fields | |
private readonly Type _type; | |
#endregion | |
#region Constructors | |
public DebugLogger(Type type) | |
{ | |
_type = type; |
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
<Application x:Class="HelloMef.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="clr-namespace:HelloMef"> | |
<Application.Resources> | |
<ResourceDictionary> | |
<ResourceDictionary.MergedDictionaries> | |
<ResourceDictionary> | |
<local:MefBootStrapper x:Key="bootstrapper" /> | |
</ResourceDictionary> |
NewerOlder