Created
December 14, 2011 06:13
-
-
Save tmiz/1475476 to your computer and use it in GitHub Desktop.
Example MonoMac 0001
This file contains hidden or 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; | |
using System.Linq; | |
using MonoMac.Foundation; | |
using MonoMac.AppKit; | |
namespace MonoDemoProject | |
{ | |
public partial class MainWindowController : MonoMac.AppKit.NSWindowController | |
{ | |
#region Constructors | |
// Called when created from unmanaged code | |
public MainWindowController (IntPtr handle) : base (handle) | |
{ | |
Initialize (); | |
} | |
// Called when created directly from a XIB file | |
[Export ("initWithCoder:")] | |
public MainWindowController (NSCoder coder) : base (coder) | |
{ | |
Initialize (); | |
count = 0; //incert code:(1) | |
} | |
// Call to load from the XIB/NIB file | |
public MainWindowController () : base ("MainWindow") | |
{ | |
Initialize (); | |
} | |
// Shared initialization code | |
void Initialize () | |
{ | |
} | |
#endregion | |
// incert code:(2) | |
private uint count; | |
partial void click (MonoMac.Foundation.NSObject sender) | |
{ | |
string value = string.Format("count:{0}", count); | |
mainLabel.SetValueForKey((NSString)value, (NSString)"stringValue"); | |
if (uint.MaxValue > count) { | |
count += 1; | |
} | |
} | |
//strongly typed window accessor | |
public new MainWindow Window { | |
get { | |
return (MainWindow)base.Window; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment