This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using MonoTouch.Foundation; | |
using MonoTouch.ObjCRuntime; | |
using MonoTouch.UIKit; | |
namespace iOSLib | |
{ | |
public static class ViewExtensions | |
{ | |
static Dictionary<UIView, Dictionary<UISwipeGestureRecognizerDirection, SwipeClass>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DebuggerDisplay("{Title}, Desc({Description}), Link({Link})")] | |
public class Item | |
{ | |
public Item(XElement x) | |
{ | |
Title = x.Element("title").Value; | |
Description = x.Element("description").Value; | |
XElement link = x.Element("link"); | |
if(null != link) | |
Link = link.Value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Paths | |
{ | |
/// <summary> | |
/// Apply Path.Combine(on path and list) | |
/// </summary> | |
/// <param name="path"></param> | |
/// <param name="list"></param> | |
/// <returns></returns> | |
public static string Combine(string path, params string[] list) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Xml; | |
using System.Xml.Linq; | |
namespace XmlLib | |
{ | |
/// <summary> | |
/// Provides extension methods for simple conversion between System.Xml and System.Xml.Linq classes. | |
/// </summary> | |
/// <remarks>From: http://brianary.blogspot.com/2010/02/converting-between-xdocument-and.html</remarks> | |
public static class XmlLinqConversionExtensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace ZipMany | |
{ | |
/// <summary> | |
/// Zip multiple arrays (more than 2 since there is a built in Zip for 2 with .Net 4.0) | |
/// </summary> | |
public static class ZipMultiple | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ObservableValue<T> : INotifyPropertyChanged | |
{ | |
public class MyArgs : PropertyChangedEventArgs | |
{ | |
public MyArgs(string propertyName, T old, T @new) | |
: base(propertyName) | |
{ | |
Old = old; | |
New = @new; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Edit MapMagicWindow.cs | |
Make the following method static, it doesn't reference internal class data, so it is ok. | |
private static Generator[] SmartCopyGenerators(Generator gen) | |
Then refactor the SaveGenerator method, extracting the file saving to a public static ExportToFile method | |
void SaveGenerator(Generator gen, Vector2 pos) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Modified this guys code - http://www.zedia.net/2013/ngui-unity3d-getting-screen-size/comment-page-1/ | |
*/ | |
public static class DisplaySize | |
{ | |
public static float ScreenHeight(this Transform t) | |
{ | |
UIRoot root = t.root.GetComponent<UIRoot>() ?? NGUITools.FindInParents<UIRoot>(t); | |
float ratio = (float)root.activeHeight / Screen.height; | |
return Mathf.Ceil(Screen.height * ratio); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Includes a mini-program for checking and fixing files that have no extension | |
// Only checks for the most common types | |
// If you create a better version, please upload it here. | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
namespace AppendJPG | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dco.pe/vsb | |
const float MinValueToActivateRedLights = 5000f; | |
const float VolumeOfDrills = 33750f; // small ship drill (large is 234375f) | |
public Program() | |
{ | |
Runtime.UpdateFrequency = UpdateFrequency.Update100; | |
} |
OlderNewer