Skip to content

Instantly share code, notes, and snippets.

View KonajuGames's full-sized avatar

Steve 'Sly' Williams KonajuGames

View GitHub Profile
@KonajuGames
KonajuGames / DisposeExample.cs
Created November 1, 2017 16:37
Implementing the Dispose pattern
using System;
namespace Example
{
public class DisposeExample: IDisposable
{
// An example reference to another managed object.
object managedObject;
// An example reference to another object that also implements IDisposable.
@KonajuGames
KonajuGames / gist:9466564
Created March 10, 2014 14:58
MonoDevelop C# Formatting solution
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = MonoGame.Framework\MonoGame.Framework.WindowsGL.csproj
Policies = $0
$0.TextStylePolicy = $1
$1.inheritsSet = null
$1.scope = text/x-csharp
$0.CSharpFormattingPolicy = $2
$2.AlignEmbeddedUsingStatements = False
$2.AlignEmbeddedIfStatements = False
$2.IndentPreprocessorDirectives = False
@KonajuGames
KonajuGames / gist:9466530
Created March 10, 2014 14:56
MonoDevelop C# Formatting section
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<DotNetNamingPolicy DirectoryNamespaceAssociation="PrefixedHierarchical" ResourceNamePolicy="FileFormatDefault" />
<TextStylePolicy inheritsSet="VisualStudio" inheritsScope="text/plain" scope="text/x-csharp" />
<CSharpFormattingPolicy IndentSwitchBody="True" IndentPreprocessorDirectives="False" AnonymousMethodBraceStyle="NextLine" PropertyBraceStyle="NextLine" PropertyGetBraceStyle="NextLine" PropertySetBraceStyle="NextLine" EventBraceStyle="NextLine" EventAddBraceStyle="NextLine" EventRemoveBraceStyle="NextLine" StatementBraceStyle="NextLine" ElseNewLinePlacement="NewLine" ElseIfNewLinePlacement="NewLine" CatchNewLinePlacement="NewLine" FinallyNewLinePlacement="NewLine" WhileNewLinePlacement="DoNotCare" ArrayInitializerWrapping="DoNotChange" ArrayInitializerBraceStyle="NextLine" BeforeMethodDeclarationParentheses="False" BeforeMethodCallParentheses="False" BeforeConstructorDeclarationParentheses="False
@KonajuGames
KonajuGames / OuyaComponent.cs
Created February 4, 2014 23:47
Checking receipts and making purchases with ouya-csharp
using System;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.GamerServices;
using Ouya.Console.Api;
namespace Iap
{
class OuyaComponent : GameComponent
{
@KonajuGames
KonajuGames / gist:1954646
Created March 2, 2012 01:33
Android OpenGL background context
using System;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.ES20;
using OpenTK.Platform;
using OpenTK.Platform.Android;
using Android.Views;
using Android.Content;