当前位置: 首页>>代码示例>>C#>>正文


C# Foundation.NSObject类代码示例

本文整理汇总了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>();
        }
开发者ID:ataranto,项目名称:tepeyac,代码行数:32,代码来源:AppDelegate.cs

示例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 ();
        }
开发者ID:Clodo76,项目名称:airvpn-client,代码行数:25,代码来源:AppDelegate.cs

示例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);
			}
开发者ID:roblillack,项目名称:monomac,代码行数:25,代码来源:BookmarkAssistantController.cs

示例4: RemoveAction

		public static void RemoveAction (NSObject target, EventHandler handler)
		{
			ActionDispatcher ctarget = target as ActionDispatcher;
			if (ctarget == null)
				return;
			ctarget.Activated -= handler;
		}
开发者ID:kangaroo,项目名称:monomac,代码行数:7,代码来源:ActionDispatcher.cs

示例5: FinishedLaunching

        public override void FinishedLaunching (NSObject notification)
        {
            RxApp.MutableResolver.Register(() => new TestViewController(), typeof(IViewFor<TestViewModel>));

            mainWindowController = new MainWindowController ();
            mainWindowController.Window.MakeKeyAndOrderFront (this);
        }
开发者ID:KimCM,项目名称:ReactiveUI,代码行数:7,代码来源:AppDelegate.cs

示例6: SecondsStepperAction

partial         void SecondsStepperAction(NSObject sender)
        {
            NSStepper stepper = sender as NSStepper;

             //Console.WriteLine ("Change level: {0}", stepper.IntValue);
             SecondsTextField.IntValue = stepper.IntValue;
        }
开发者ID:enecciari,项目名称:mackeepass,代码行数:7,代码来源:PreferencesWindowController.cs

示例7: FinishedLaunching

        public override void FinishedLaunching(NSObject notification)
        {
            mainWindowController = new MainWindowController ();
            mainWindowController.Window.MakeKeyAndOrderFront (this);

            NativeTest.Hello ();
        }
开发者ID:baulig,项目名称:Provcon-Faust,代码行数:7,代码来源:AppDelegate.cs

示例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;
     }
 }
开发者ID:yudhitech,项目名称:xamarin-macios,代码行数:29,代码来源:MacApiCtorInitTest.cs

示例9: saveDocument

		partial void saveDocument(NSObject sender)
		{
			if (FileSave != null)
			{
				FileSave(this, EventArgs.Empty);
			}
		}
开发者ID:ngeor,项目名称:ResxTranslator,代码行数:7,代码来源:MainWindowController.cs

示例10: addKey

		partial void addKey(NSObject sender)
		{
			if (KeyAdd != null)
			{
				KeyAdd(this, EventArgs.Empty);
			}
		}
开发者ID:ngeor,项目名称:ResxTranslator,代码行数:7,代码来源:MainWindowController.cs

示例11: openDocument

		partial void openDocument(NSObject sender)
		{
			if (FileOpen != null)
			{
				FileOpen(this, EventArgs.Empty);
			}
		}
开发者ID:ngeor,项目名称:ResxTranslator,代码行数:7,代码来源:MainWindowController.cs

示例12: newDocument

		partial void newDocument(NSObject sender)
		{
			if (FileNew != null)
			{
				FileNew(this, EventArgs.Empty);
			}
		}
开发者ID:ngeor,项目名称:ResxTranslator,代码行数:7,代码来源:MainWindowController.cs

示例13: MakeKeyAndOrderFront

		public override void MakeKeyAndOrderFront(NSObject sender)  {

			base.MakeKeyAndOrderFront (sender);
            /// Program entry point is here

            //TODO: Mac - really here??? Nooo
        }
开发者ID:vhnatyk,项目名称:WebMarco.2.0,代码行数:7,代码来源:MainWindow.cs

示例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));
				});
			}
		}
开发者ID:utahking,项目名称:monomac,代码行数:30,代码来源:AppDelegate.cs

示例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);
        }
开发者ID:jonlipsky,项目名称:CollectionView,代码行数:25,代码来源:AppDelegate.cs


注:本文中的MonoMac.Foundation.NSObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。