Skip to content

Instantly share code, notes, and snippets.

View jonpryor's full-sized avatar

Jonathan Pryor jonpryor

View GitHub Profile
void scrim_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
XElement xmlScrim = XElement.Parse(e.Result, LoadOptions.None);
RunOnUiThread(() => {
var scrimresult = FindViewById<EditText>(Resource.Id.result);
scrimresult.Text = xmlScrim.Element("url").Value;
});
}
// nested enum type
using System;
class Test {
public enum Foo {
A
}
static void Main ()
{
using System;
using System.Reflection;
[assembly: AssemblyVersion("2.2.*")]
class Test {
static void Main ()
{
Console.WriteLine ("Version: {0}",
Assembly.GetExecutingAssembly ().GetName ().Version);
using System;
using System.Net;
using System.Linq;
using System.Text;
class Test {
public static void Main ()
{
WebHeaderCollection headers = new WebHeaderCollection();
headers.Add("test1","test2");
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ENV_VAR</key>
<string>VALUE</string>
</dict>
</plist>
<Member MemberName="Sort">
<MemberSignature Language="ILAsm" Value=".method public hidebysig static void Sort(class System.Array keys, class System.Array items, int32 index, int32 length, class System.Collections.IComparer comparer)" />
<MemberSignature Language="C#" Value="public static void Sort(Array keys, Array items, int index, int length, IComparer comparer);" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="keys" Type="System.Array" />
<Parameter Name="items" Type="System.Array" />
using System;
using System.Threading;
using Mono.Unix;
using Mono.Unix.Native;
class Test {
static void Main ()
{
StartHandler();
Console.WriteLine("Press any key to exit...");
[Register ("android/accounts/AccountManagerFuture", DoNotGenerateAcw=true)]
interface IAccountManagerFuture {
[Register ("cancel", "(Z)Z", "GetCancelHandler:AccountManagerFutureInvoker, YourAssemblyName, Version=0.0.0")]
bool Cancel (bool mayInterruptIfRunning);
// ...
}
class IAccountManagerFutureInvoker : IAccountManagerFuture {
class ValueComparer<T> : IComparer<T>, IEqualityComparer<T>
{
Func<T, T, int> comparer;
Func<T, int> getHashCode;
public ValueComparer(Func<T, T, int> comparer, Func<T, int> getHashCode = null)
{
this.comparer = comparer;
this.getHashCode = getHashCode;
}
/* output:
# test2: (* 10 10 )
# test: (+ 10 ((* 10 10 )))
# test2: (* 10 10 )
*/
namespace Schemin.AST
{
public interface IScheminType
{