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
internal class DebugLogger : Caliburn.Micro.ILog | |
{ | |
#region Implementation of ILog | |
public void Info(string format, params object[] args) | |
{ | |
System.Diagnostics.Debug.Write("[" + DateTime.Now.ToString("o") + "] ", "INFO"); | |
System.Diagnostics.Debug.WriteLine(format, args); | |
} | |
public void Warn(string format, params object[] args) | |
{ |
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 MefBootStrapper<TRootModelView> : Bootstrapper<TRootModelView> | |
{ | |
#region Fields | |
private readonly ILog _logger = LogManager.GetLog(typeof(MefBootStrapper<TRootModelView>)); | |
private CompositionContainer _container; | |
#endregion | |
#region Overrides | |
protected override void Configure() | |
{ // configure container |
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
<TemplatesExport family="File Templates"> | |
<Template uid="3d240306-9708-46d9-955c-4f06c2f803a7" | |
shortcut="" | |
description="Caliburn Micro View Model" | |
text="using System;
using Caliburn.Micro;
using $ROOTNAMESPACE$.Messages;

namespace $NAMESPACE$
{
 public class $CLASS$ : $BASECLASS$
 {
 #region Fields
 private readonly IEventAggregator _messageBus;
 #endregion
 
 #region Constructors
 public $CLASS$(IEventAggregator messageBus)
 {
 _messageBus = messageBus;
 // Uncomment this if you want to handle any messages
 //_messageBus.Subscribe(this);
 }
 #endregion
 $END$
 }
}" | |
reformat="True" | |
shortenQualifiedReferences="True"> | |
<Context> | |
<ProjectLanguageContext language="CSharp" /> | |
</Context> |
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
public static class EventAggregatorExtensions | |
{ | |
public static void Subscribe(this IEventAggregator eventAggregator, params IHandle[] handlers) | |
{ | |
Subscribe(eventAggregator, (IEnumerable<IHandle>)handlers); | |
} | |
public static void Subscribe(this IEventAggregator eventAggregator, IEnumerable<IHandle> handlers) | |
{ | |
foreach(var handler in handlers) |
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 ObjectExtensions | |
{ | |
/// <summary> | |
/// Returns the result of <paramref name="func"/> if <paramref name="obj"/> is not null. | |
/// <example> | |
/// <code> | |
/// Request.Url.Evaluate(x => x.Query) | |
/// </code> | |
/// </example> | |
/// </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
using System; | |
using System.Linq; | |
using System.Windows; | |
using Microsoft.VisualBasic.ApplicationServices; | |
using StartupEventArgs = Microsoft.VisualBasic.ApplicationServices.StartupEventArgs; | |
namespace Utility | |
{ | |
public class SingleInstanceManager : WindowsFormsApplicationBase | |
{ |
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; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
namespace Utility | |
{ | |
public class Loader |
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 Autofac; | |
using Autofac.Core; | |
using ReactiveUI; | |
using Splat; | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace ReactiveUI |
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; | |
using Microsoft.Practices.Unity; | |
using System.Collections.Generic; | |
namespace Hazware.Commons.Unity | |
{ | |
public class TypeTrackingExtension : UnityContainerExtension | |
{ | |
#region Fields | |
private readonly Dictionary<Type, HashSet<string>> _registeredTypes = new Dictionary<Type, HashSet<string>>(); |
OlderNewer