~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/ngit/Sharpen/Sharpen/Extensions.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
239
239
 
240
240
                public static InputStream GetResourceAsStream (this Type type, string name)
241
241
                {
242
 
                        string str2 = type.Assembly.GetName ().Name;
243
 
                        string[] textArray1 = new string[] { str2, ".resources.", type.Namespace, ".", name };
 
242
                        string str2 = type.Assembly.GetName ().Name + ".resources";
 
243
                        string[] textArray1 = new string[] { str2, ".", type.Namespace, ".", name };
244
244
                        string str = string.Concat (textArray1);
245
245
                        Stream manifestResourceStream = type.Assembly.GetManifestResourceStream (str);
246
246
                        if (manifestResourceStream == null) {
262
262
                        } catch {
263
263
                                // Not found
264
264
                        }
 
265
 
 
266
            // Mono and Java allow you to specify timezones by short id (i.e. EST instead of Eastern Standard Time).
 
267
            // Mono on Windows and the microsoft framewokr on windows do not allow this. This hack is to compensate
 
268
            // for that and allow you to match 'EST' to 'Eastern Standard Time' by matching the first letter of each
 
269
            // word to the corresponding character in the short string. Bleh.
 
270
                        if (tzone.Length <= 4) {
 
271
                                foreach (var timezone in TimeZoneInfo.GetSystemTimeZones ()) {
 
272
                                        var parts = timezone.Id.Split (new [] {' '}, StringSplitOptions.RemoveEmptyEntries);
 
273
                                        if (parts.Length == tzone.Length) {
 
274
                                                bool found = true;
 
275
                                                for (int i = 0; i <parts.Length; i++)
 
276
                                                        found &= parts[i][0] == tzone[i];
 
277
 
 
278
                                                if (found)
 
279
                                                        return timezone;
 
280
                                        }
 
281
                                }
 
282
                        }
265
283
                        char[] separator = new char[] { ':' };
266
284
                        string[] strArray = tzone.Substring (4).Split (separator);
267
285
                        int hours, minutes;
608
626
                public static int GetTotalInFixed (this Inflater inf)
609
627
                {
610
628
                        if (inf.TotalIn > 0)
611
 
                                return inf.TotalIn + 4;
 
629
                                return Convert.ToInt32( inf.TotalIn ) + 4;
612
630
                        else
613
631
                                return 0;
614
632
                }