Skip to content

Instantly share code, notes, and snippets.

@fabmoll
fabmoll / WPLogger
Last active December 15, 2015 14:09
Logger for Windows Phone (LogFormat and LogLevel added by @ScottIsAFool )
// Usage:
// private static readonly ILog Logger = new Logger(typeof(YOUR_CLASS_NAME));
//
// In your method:
// Logger.Log("Application_Launching");
public interface ILog
{
void Log(string message, LogLevel logLevel = LogLevel.Info);
void LogFormat(string format, LogLevel logLevel = LogLevel.Info, params object[] parameters);
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
@fabmoll
fabmoll / SettingsHelper.cs
Created January 21, 2013 18:55
Helper to read/write settings in the IsolatedStorage
public interface ISettingsHelper
{
T GetSetting<T>(string settingName, T defaultValue);
void UpdateSetting<T>(string settingName, T value);
}
public class SettingsHelper : ISettingsHelper
{
private readonly IsolatedStorageSettings _settings = IsolatedStorageSettings.ApplicationSettings;
@fabmoll
fabmoll / ReSharper-MSTest-TestMethod
Created January 16, 2013 12:17
ReSharper Live Template for MSTest (create TestMethod method)
[TestMethod]
public void $MethodNameTest$()
{
$END$
}
@fabmoll
fabmoll / ReSharper-MSTest-TestInitialize
Created January 16, 2013 12:15
ReSharper Live Template for MSTest (create TestInitialize method)
[TestInitialize]
public void TestInitialize()
{
$END$
}
@fabmoll
fabmoll / ReSharper-MSTest-TestClass
Last active December 11, 2015 04:39
ReSharper File Template for MSTest
using Microsoft.VisualStudio.TestTools.UnitTesting;
$HEADER$namespace $NAMESPACE$
{
[TestClass]
public class $CLASS$ {$END$}
}
using System.Data.Linq;
using Microsoft.Phone.Data.Linq;
namespace MyNameSpace.Database
{
public class MyDataContext : DataContext
{
public MyDataContext(string connectionString)
: base(connectionString)
{ }