本文整理汇总了C#中MonoMac.Foundation.NSObject类的典型用法代码示例。如果您正苦于以下问题:C# NSObject类的具体用法?C# NSObject怎么用?C# NSObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NSObject类属于MonoMac.Foundation命名空间,在下文中一共展示了NSObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FinishedLaunching
public override void FinishedLaunching(NSObject notification)
{
try
{
LSSharedFileList.InsertLoginItem(NSBundle.MainBundle.BundlePath);
}
catch
{
}
var container = new Container();
Tepeyac.Funq.Registry.Register(container);
container.Register<IFiber>("GuiFiber", c =>
{
var executor =
c.Resolve<IExecutor>() ??
new Executor();
var fiber = new CocoaFiber(executor);
fiber.Start();
return fiber;
});
container.Register<ILauncher>(c =>
new Tepeyac.UI.Cocoa.Launcher());
container.Register<IBurritoDayView>(c =>
new StatusItemBurritoDayView(c));
container.Resolve<IBurritoDayView>();
}
示例2: FinishedLaunching
public override void FinishedLaunching(NSObject notification)
{
Engine.Instance.TerminateEvent += delegate() {
new NSObject ().InvokeOnMainThread (() => {
//NSApplication.SharedApplication.ReplyToApplicationShouldTerminate (true);
NSApplication.SharedApplication.Terminate(new NSObject ());
});
};
UpdateInterfaceStyle ();
mainWindowController = new MainWindowController ();
bool startVisible = Engine.Instance.Storage.GetBool("gui.osx.visible");
if (startVisible) {
mainWindowController.Window.MakeKeyAndOrderFront (this);
} else {
mainWindowController.Window.IsVisible = false;
}
NSApplication.SharedApplication.ActivateIgnoringOtherApps (true);
NSProcessInfo.ProcessInfo.DisableSuddenTermination (); // Already disabled by default
MenuEvents ();
}
示例3: SetObjectValue
public override void SetObjectValue (NSTableView tableView, NSObject theObject, NSTableColumn tableColumn, int row)
{
NSString newNSValue = theObject as NSString;
if (newNSValue == null)
return;
string newValue = newNSValue.ToString ();
int columnIndex = tableView.FindColumn ((NSString)tableColumn.Identifier);
BookmarkManager.Entry entry = entries[row];
switch (columnIndex) {
case 0:
if (!string.IsNullOrWhiteSpace (newValue))
entry.Name = newValue;
break;
case 1:
entry.Notes = newValue;
break;
case 2:
if (!string.IsNullOrWhiteSpace (newValue))
entry.Url = newValue;
break;
default:
break;
}
manager.CommitBookmarkChange (entry);
}
示例4: RemoveAction
public static void RemoveAction (NSObject target, EventHandler handler)
{
ActionDispatcher ctarget = target as ActionDispatcher;
if (ctarget == null)
return;
ctarget.Activated -= handler;
}
示例5: FinishedLaunching
public override void FinishedLaunching (NSObject notification)
{
RxApp.MutableResolver.Register(() => new TestViewController(), typeof(IViewFor<TestViewModel>));
mainWindowController = new MainWindowController ();
mainWindowController.Window.MakeKeyAndOrderFront (this);
}
示例6: SecondsStepperAction
partial void SecondsStepperAction(NSObject sender)
{
NSStepper stepper = sender as NSStepper;
//Console.WriteLine ("Change level: {0}", stepper.IntValue);
SecondsTextField.IntValue = stepper.IntValue;
}
示例7: FinishedLaunching
public override void FinishedLaunching(NSObject notification)
{
mainWindowController = new MainWindowController ();
mainWindowController.Window.MakeKeyAndOrderFront (this);
NativeTest.Hello ();
}
示例8: CheckToString
protected override void CheckToString(NSObject obj)
{
switch (obj.GetType ().FullName) {
// native crash calling MonoMac.Foundation.NSObject.get_Description ()
case "WebKit.WKNavigationAction":
case "WebKit.WKFrameInfo": // EXC_BAD_ACCESS (code=1, address=0x0)
case "MonoMac.Foundation.NSUrlConnection":
case "Foundation.NSUrlConnection":
case "MonoMac.AppKit.NSLayoutConstraint": // Unable to create description in descriptionForLayoutAttribute_layoutItem_coefficient. Something is nil
case "AppKit.NSLayoutConstraint":
case "MonoMac.AVFoundation.AVPlayerItemTrack":
case "AVFoundation.AVPlayerItemTrack":
// 10.8
case "MonoMac.AVFoundation.AVComposition":
case "AVFoundation.AVComposition":
case "MonoMac.GameKit.GKPlayer": // Crashing on 10.8.3 from the Apple beta channel for abock (on 2013-01-30)
case "GameKit.GKPlayer":
case "MonoMac.AVFoundation.AVAssetResourceLoadingRequest": // Crashing on 10.9.1 for abock (2014-01-13)
case "AVFoundation.AVAssetResourceLoadingRequest":
case "MonoMac.AVFoundation.AVAssetResourceLoadingDataRequest": // Crashes on 10.9.3 for chamons (constructor found in AVCompat)
case "AVFoundation.AVAssetResourceLoadingDataRequest":
case "MonoMac.AVFoundation.AVCaptureDeviceInputSource": // Crashes on 10.9.5
case "AVFoundation.AVCaptureDeviceInputSource":
break;
default:
base.CheckToString (obj);
break;
}
}
示例9: saveDocument
partial void saveDocument(NSObject sender)
{
if (FileSave != null)
{
FileSave(this, EventArgs.Empty);
}
}
示例10: addKey
partial void addKey(NSObject sender)
{
if (KeyAdd != null)
{
KeyAdd(this, EventArgs.Empty);
}
}
示例11: openDocument
partial void openDocument(NSObject sender)
{
if (FileOpen != null)
{
FileOpen(this, EventArgs.Empty);
}
}
示例12: newDocument
partial void newDocument(NSObject sender)
{
if (FileNew != null)
{
FileNew(this, EventArgs.Empty);
}
}
示例13: MakeKeyAndOrderFront
public override void MakeKeyAndOrderFront(NSObject sender) {
base.MakeKeyAndOrderFront (sender);
/// Program entry point is here
//TODO: Mac - really here??? Nooo
}
示例14: FinishedLaunching
public override void FinishedLaunching (NSObject notification)
{
var indexManager = IndexUpdateManager;
indexManager.CheckIndexIsFresh ().ContinueWith (t => {
if (t.IsFaulted)
Console.WriteLine ("Error while checking indexes: {0}", t.Exception);
else if (!t.Result)
indexManager.PerformSearchIndexCreation ();
else
indexManager.AdvertiseFreshIndex ();
}).ContinueWith (t => Console.WriteLine ("Error while creating indexes: {0}", t.Exception), TaskContinuationOptions.OnlyOnFaulted);
// Check if there is a MonoTouch documentation installed and launch accordingly
if (Root.HelpSources.Cast<HelpSource> ().Any (hs => hs.Name.StartsWith ("MonoTouch", StringComparison.InvariantCultureIgnoreCase))
&& File.Exists (mergeToolPath)) {
Task.Factory.StartNew (() => {
AppleDocHandler.AppleDocInformation infos;
bool mergeOutdated = false;
bool docOutdated = AppleDocHandler.CheckAppleDocFreshness (AppleDocHandler.IosAtomFeed, out infos);
if (!docOutdated)
mergeOutdated = AppleDocHandler.CheckMergedDocumentationFreshness (infos);
return Tuple.Create (docOutdated || mergeOutdated, docOutdated, mergeOutdated);
}).ContinueWith (t => {
Console.WriteLine ("Merged status {0}", t.Result);
if (!t.Result.Item1)
return;
BeginInvokeOnMainThread (() => LaunchDocumentationUpdate (t.Result.Item2, t.Result.Item3));
});
}
}
示例15: FinishedLaunching
public override void FinishedLaunching(NSObject notification)
{
mainWindowController = new MainWindowController ();
var window = mainWindowController.Window;
window.MakeKeyAndOrderFront (this);
titles = new NSObject[] {
new NSString("Item 1"),
new NSString("Item 2"),
new NSString("Item 3"),
new NSString("Item 4"),
new NSString("Item 5"),
new NSString("Item 6"),
new NSString("Item 7"),
new NSString("Item 8"),
};
cv = new NSCollectionView(window.ContentView.Frame);
cvi = new MyCollectionViewItem();
cv.ItemPrototype = cvi;
cv.Content = titles;
cv.AutoresizingMask = NSViewResizingMask.MinXMargin | NSViewResizingMask.WidthSizable | NSViewResizingMask.MaxXMargin | NSViewResizingMask.MinYMargin | NSViewResizingMask.HeightSizable | NSViewResizingMask.MaxYMargin;
window.ContentView.AddSubview(cv);
}