Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: f237c7fa7f
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (27 sloc) 0.697 kB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Git.Credential.WinStore
static class Extensions
public static TValue GetOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> self, TKey key, TValue def)
TValue ret;
if (!self.TryGetValue(key, out ret))
return def;
return ret;
public static string TruncateTo(this string self, int maxlength)
if (self.Length > maxlength)
return self.Substring(0, maxlength);
return self;
Jump to Line
Something went wrong with that request. Please try again.