Skip to content

Instantly share code, notes, and snippets.

View davidroth's full-sized avatar

David Roth davidroth

View GitHub Profile
@davidroth
davidroth / EntityFramwork DbModelStore for loading cached db models.
Created March 31, 2014 06:19
EntityFramwork DbConfiguration with custom DbModelStore for loading cached db models. The custom DbModelStore invalidates out-of-date cache files by comparing the last update date of the cache-xml to the update date of the domain assembly.
public class MyContextConfiguration : DbConfiguration
{
public MyContextConfiguration()
{
MyDbModelStore cachedDbModelStore = new MyDbModelStore(MyContext.EfCacheDirPath);
IDbDependencyResolver dependencyResolver = new SingletonDependencyResolver<DbModelStore>(cachedDbModelStore);
AddDependencyResolver(dependencyResolver);
}
private class MyDbModelStore : DefaultDbModelStore
@davidroth
davidroth / FastImportRewriter.cs
Last active February 1, 2020 16:06
Fast-Import / Fast-Export Rewriter to migrate bazaar bugtracking metdata properties to git. More infos: http://www.fusonic.net/en/blog/migrating-from-bazaar-to-git/ Licence: Mit X11 / BSD
// Fast-Import / Fast-Export Rewriter to migrate bazaar bugtracking metdata properties to git.
// More infos: http://www.fusonic.net/en/blog/migrating-from-bazaar-to-git/
// Licence: Mit X11 / BSD
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Text;
using System.Diagnostics;
using System.Collections.Generic;
@davidroth
davidroth / ToastView.cs
Last active September 26, 2015 13:48
ToastView allows to show UIToasts on the Iphone via Monotouch and C#
// Licence: MIT X11
// Note: This is an Objective-C to C# translation by using code from: http://code.google.com/p/toast-notifications-ios/
namespace Fusonic.Monotouch.Utils
{
public class ToastView : NSObject
{
ToastSettings theSettings = new ToastSettings ();
private string text = null;
private UIView view;
@davidroth
davidroth / UIAlertHelper.cs
Created July 11, 2011 11:18
A simple helper class for monotouch which provides you an easy to use API for showing alerts with buttons. The class will handle the reference tracking and alert queue for you.
namespace Fusonic.Monotouch.Utils
{
public class ButtonAction
{
public ButtonAction (string title, Action callback)
{
Title = title;
Callback = callback;
}