本文整理汇总了C#中MonoMac类的典型用法代码示例。如果您正苦于以下问题:C# MonoMac类的具体用法?C# MonoMac怎么用?C# MonoMac使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MonoMac类属于命名空间,在下文中一共展示了MonoMac类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button
partial void Button(MonoMac.Foundation.NSObject sender)
{
RunTests ();
var number = power.Compute (++current);
Label.StringValue = string.Format ("{0} is the power!", number);
}
示例2: GetCell
public override NSCell GetCell(NSOutlineView view, NSTableColumn column, MonoMac.Foundation.NSObject item)
{
NSCmisTree cmis = item as NSCmisTree;
if (cmis == null) {
Console.WriteLine ("GetCell Error");
return null;
}
if (column == null) {
return null;
} else if (column.Identifier.Equals ("Name")) {
// Console.WriteLine ("GetCell " + cmis);
NSButtonCell cell = new NSButtonCell ();
if (cmis.Parent != null)
cell.SetButtonType (NSButtonType.Switch);
else
cell.SetButtonType (NSButtonType.Radio);
// FIXME cell.AllowsMixedState = true;
cell.Title = cmis.Name;
cell.Editable = true;
return cell;
} else {
NSTextFieldCell cell = new NSTextFieldCell ();
return cell;
}
}
示例3: NewDocument
public void NewDocument(MonoMac.Foundation.NSObject sender)
{
mainWindowController.Window.MakeKeyAndOrderFront(this);
// call mainWindowController and tell him to do something new
mainWindowController.NewDocument();
}
示例4: exportFile
partial void exportFile(MonoMac.AppKit.NSButton sender)
{
var scfExport = new ExportSCF(txt_input.StringValue, txt_output.StringValue);
NSTextView txt = (NSTextView) txt_fld_output.DocumentView;
//txt.TextStorage.Append(new NSAttributedString(parser.GetParseOutput()));
txt.TextStorage.Append(new NSAttributedString(scfExport.DebugOutput));
}
示例5: FinishedLaunching
public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
{
game = new ParticleSampleGame();
game.Run ();
}
示例6: FinishedLaunching
public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
{
// Don't use 'using' to dispose of this
// On Mac, the game is run on a background thread
_game = new ShowcaseGame();
_game.Run();
}
示例7: checkNowClick
partial void checkNowClick(MonoMac.Foundation.NSObject sender)
{
//TODO breakout getting notifications and linking it all up into a function
//TODO use settings for token
Notifications.DoNotificationCheck();
}
示例8: FinishedLaunching
public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
{
using (var game = PlatformManager.Game)
{
game.Run();
}
}
示例9: FinishedLaunching
public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
{
Directory.SetCurrentDirectory(NSBundle.MainBundle.ResourcePath);
if (getMaxfiles() < 512) {
runCommand("launchctl", "limit maxfiles 512 4096");
string execPath = NSBundle.MainBundle.BundlePath;
int processId = NSProcessInfo.ProcessInfo.ProcessIdentifier;
NSTask.LaunchFromPath("relaunch", new string[]{execPath, processId.ToString()});
Environment.Exit(0);
}
WebClient updateClient = new WebClient();
updateClient.DownloadStringCompleted += UpdateCheckCompleted;
updateClient.DownloadStringAsync(new Uri("http://dl.dropbox.com/u/76985/MacTerraria_update.txt"));
patchTerraria(Path.Combine(NSBundle.MainBundle.ResourcePath, "exes", "Terraria.exe"),
Path.Combine(NSBundle.MainBundle.ResourcePath, "Terraria.exe"));
string savePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "My Games", "Terraria");
Directory.CreateDirectory(savePath);
Assembly assembly = Assembly.LoadFrom(Path.Combine(NSBundle.MainBundle.ResourcePath, "Terraria.exe"));
Type mainType = assembly.GetType("Terraria.Main");
object game = Activator.CreateInstance(mainType);
mainType.InvokeMember("Run", BindingFlags.Default | BindingFlags.InvokeMethod, null, game, null);
}
示例10: FinishedLaunching
public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
{
using (RolePlayingGame game = new RolePlayingGame())
{
game.Run();
}
}
示例11: FinishedLaunching
public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
{
if (mainFormFunc != null)
main_form = mainFormFunc ();
main_form.m_helper.MakeKeyAndOrderFront (this);
main_form.m_helper.DidChangeScreen += delegate(object sender, EventArgs e) { main_form.m_helper.Display (); };
}
示例12: IsSelectorExcludedFromWebScript
public static bool IsSelectorExcludedFromWebScript(MonoMac.ObjCRuntime.Selector aSelector)
{
if (aSelector.Name == "callFromJs")
return false;
return true; // Запрещаем вызов всех остальных методов
}
示例13: NotifyMeAction
partial void NotifyMeAction (MonoMac.AppKit.NSButton sender)
{
// First we create our notification and customize as needed
NSUserNotification not = new NSUserNotification();
not.Title = "Hello World";
not.InformativeText = "This is an informative text";
not.DeliveryDate = DateTime.Now;
not.SoundName = NSUserNotification.NSUserNotificationDefaultSoundName;
// We get the Default notification Center
NSUserNotificationCenter center = NSUserNotificationCenter.DefaultUserNotificationCenter;
center.DidDeliverNotification += (s, e) =>
{
Console.WriteLine("Notification Delivered");
DeliveredColorWell.Color = NSColor.Green;
};
center.DidActivateNotification += (s, e) =>
{
Console.WriteLine("Notification Touched");
TouchedColorWell.Color = NSColor.Green;
};
// If we return true here, Notification will show up even if your app is TopMost.
center.ShouldPresentNotification = (c, n) => { return true; };
center.ScheduleNotification(not);
}
示例14: FinishedLaunching
public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
{
CCApplication application = new CCApplication ();
application.ApplicationDelegate = new GameAppDelegate ();
application.StartGame ();
}
示例15: DrawRect
public override void DrawRect(MonoMac.Foundation.NSRect dirtyRect)
{
base.DrawRect (dirtyRect);
var context = MonoMac.AppKit.NSGraphicsContext.CurrentContext.GraphicsPort;
context.SetFillColor (new MonoMac.CoreGraphics.CGColor (1, 0, 0));
context.FillRect (new System.Drawing.RectangleF (5, 5, 10, 10));
//base.DrawRect (dirtyRect);
}