本文整理汇总了C#中AppKit类的典型用法代码示例。如果您正苦于以下问题:C# AppKit类的具体用法?C# AppKit怎么用?C# AppKit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AppKit类属于命名空间,在下文中一共展示了AppKit类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: didRegister
partial void didRegister(AppKit.NSButton sender)
{
//register for an event
MessageBus.Default.Register (MessageHandler);
//register for CustomMessageBusEvent
MessageBus.Default.Register<CustomMessageBusEvent> (CustomMessageEventHandler);
}
示例2: powerStateChanged
partial void powerStateChanged (AppKit.NSSegmentedControl sender)
{
NSError error;
CurrentInterface.SetPower(powerState.SelectedSegment == 0, out error);
if(error != null)
Console.WriteLine("Error occurred while changing interface power state: {0}", error.LocalizedDescription);
}
示例3: OnClickedLoad
partial void OnClickedLoad(AppKit.NSButton sender)
{
try
{
grvAvatar.Avatar = new Gravatar(txtEmail.StringValue);
}
catch (Exception ex)
{
Console.WriteLine("");
}
}
示例4: didSendMessage
partial void didSendMessage(AppKit.NSButton sender)
{
var message = txtMessage.StringValue;
//Creare a MessageBusEvent
var aEvent = new CoreMessageBusEvent (kEventID) {
Sender = this,
Data = new object[]{ message },
};
//send it
MessageBus.Default.Post (aEvent);
}
示例5: GetViewForItem
public AppKit.NSView GetViewForItem (AppKit.NSTableView tableView, AppKit.NSTableColumn tableColumn, System.nint row)
{
if (viewModel.Tweets.Count < row)
return null;
TweetView view = (TweetView)tableView.MakeView (identifer, this);
if (view == null) {
TweetViewController c = new TweetViewController ();
view = c.View;
view.Frame = new CGRect (0, 0, tableView.Frame.Width, 0);
view.Identifier = identifer;
}
view.Tweet = viewModel.Tweets [(int)row];
return view;
}
示例6: NotifyMeAction
partial void NotifyMeAction (AppKit.NSButton sender)
{
// First we create our notification and customize as needed
NSUserNotification not = null;
try {
not = new NSUserNotification();
} catch {
new NSAlert {
MessageText = "NSUserNotification Not Supported",
InformativeText = "This API was introduced in OS X Mountain Lion (10.8)."
}.RunSheetModal (this);
return;
}
not.Title = "Hello World";
not.InformativeText = "This is an informative text";
not.DeliveryDate = (NSDate)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);
}
示例7: okButtonClicked
partial void okButtonClicked (AppKit.NSButton sender)
{
spinner.Hidden = false;
spinner.StartAnimation(this);
NSError error;
var networkName = nameTextField.StringValue;
var password = passwordTextField.StringValue;
var channelNumber = UInt32.Parse(channelPicker.SelectedItem.Title);
var security = string.IsNullOrEmpty(password) ? CWIbssModeSecurity.None : CWIbssModeSecurity.WEP40;
CurrentInterface.StartIbssModeWithSsid(new NSData(), security, channelNumber, password, out error);
spinner.StopAnimation(this);
spinner.Hidden = true;
if(error != null)
NSAlert.WithError(error).RunModal();
else
Window.Close();
}
示例8: BtnVibrantControlsCaveatsBehindWindowClicked
partial void BtnVibrantControlsCaveatsBehindWindowClicked (AppKit.NSButton sender);
示例9: BtnVibrantControlsClicked
partial void BtnVibrantControlsClicked (AppKit.NSButton sender);
示例10: BtnPerformanceExampleClicked
partial void BtnPerformanceExampleClicked (AppKit.NSButton sender);
示例11: BtnSampleMapsClicked
partial void BtnSampleMapsClicked (AppKit.NSButton sender);
示例12: BtnDemoFacetimeClicked
partial void BtnDemoFacetimeClicked (AppKit.NSButton sender);
示例13: BtnMaskImageWindowClicked
partial void BtnMaskImageWindowClicked (AppKit.NSButton sender);
示例14: BtnClickBasicSidebarPlusImages
partial void BtnClickBasicSidebarPlusImages (AppKit.NSButton sender);
示例15: cancel
partial void cancel (AppKit.NSButton sender);