Skip to content

Instantly share code, notes, and snippets.

View jonpryor's full-sized avatar

Jonathan Pryor jonpryor

View GitHub Profile
$ csharp
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> v.GetType().FullName;
"System.Int16"
csharp> v += 1;
csharp> v.GetType().FullName;
"System.Int32"
csharp> v = int.MaxValue;
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Webkit;
diff --git a/mcs/tools/mkbundle/mkbundle.cs b/mcs/tools/mkbundle/mkbundle.cs
index 945522b..77cc712 100644
--- a/mcs/tools/mkbundle/mkbundle.cs
+++ b/mcs/tools/mkbundle/mkbundle.cs
@@ -14,10 +14,10 @@ using System.Xml;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
+using System.IO.Compression;
using System.Runtime.InteropServices;
./de-DE/MyResources.resources.dll
./de-DE/Scratch.I18n.resources.dll
./fr-CA/MyResources.resources.dll
./fr-CA/Scratch.I18n.resources.dll
./MyResources.dll
./MyResources.dll.mdb
./Scratch.I18n.exe
./Scratch.I18n.exe.mdb
// To allow this project to build: https://dl.dropbox.com/u/15227809/Xamarin/HZLVBinding.zip
// Add a new file to the HZLVBinding project with these contents:
using Android.Runtime;
namespace Com.Devsmart.Android.UI {
partial class HorizontalListView {
protected override Java.Lang.Object RawAdapter {
get {return Adapter.JavaCast<Java.Lang.Object>();}
csharp> var x = XElement.Parse("<MEMLOC loc= '0x55E155' />");
csharp> x.Descendants("MEMLOC");
{ }
csharp> x.DescendantsAndSelf("MEMLOC");
{ <MEMLOC loc="0x55E155" /> }
csharp> x.DescendantNodes();
{ }
csharp> x.DescendantNodesAndSelf();
{ <MEMLOC loc="0x55E155" /> }
csharp>
using System;
using System.Linq;
using System.Threading;
class Test {
const int NumBusyWaiters = 10;
public static void Main ()
{
AppDomain.CurrentDomain.ProcessExit += (s, e) => {
@jonpryor
jonpryor / gist:4635021
Last active December 11, 2015 17:29 — forked from anonymous/gist:4635005
static readonly IList<ViewModel> registeredEntities = new List<ViewModel>();
protected static IList<ViewModel> RegisteredViewModels
{
get
{
return registeredEntities;
}
}
diff --git a/PluginExample/Program.cs b/PluginExample/Program.cs
index 7d45ae6..1e320f5 100644
--- a/PluginExample/Program.cs
+++ b/PluginExample/Program.cs
@@ -1,5 +1,6 @@
using System;
using System.Net;
+using System.IO;
using System.Security;
using System.Security.Permissions;
$ csharp
using SyMono C# Shell, type "help;" for help
Enter statements below.
csharp> using System.Text.RegularExpressions;
csharp> var r = new Regex (@"^\s*(?<name>[A-Za-z0-9_]+)\s*=\s*(?<value>[^\s]+)\s*;");
csharp> var m = r.Match ("Foo = Bar;");
csharp> m.Success;
true
csharp> var name = m.Groups ["name"].Value;