• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MonoMac类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MonoMac的典型用法代码示例。如果您正苦于以下问题:C# MonoMac类的具体用法?C# MonoMac怎么用?C# MonoMac使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MonoMac类属于命名空间,在下文中一共展示了MonoMac类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
        }
开发者ID:baulig,项目名称:animated-octo-nemesis,代码行数:7,代码来源:MainWindow.cs


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


示例3: NewDocument

        public void NewDocument(MonoMac.Foundation.NSObject sender)
        {
            mainWindowController.Window.MakeKeyAndOrderFront(this);
            // call mainWindowController and tell him to do something new

            mainWindowController.NewDocument();
        }
开发者ID:gomasch,项目名称:DotNetMasterPassword,代码行数:7,代码来源:AppDelegate.cs


示例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));
        }
开发者ID:DerRM,项目名称:Collada-Exporter,代码行数:7,代码来源:MainWindow.cs


示例5: FinishedLaunching

		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
		{
	
			game = new ParticleSampleGame();
			game.Run ();
	
		}
开发者ID:Nailz,项目名称:MonoGame-Samples,代码行数:7,代码来源:Program.cs


示例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();
 }
开发者ID:rtabbara,项目名称:Cocos3D-XNA,代码行数:7,代码来源:Program.cs


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


示例8: FinishedLaunching

 public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
 {
     using (var game = PlatformManager.Game)
     {
         game.Run();
     }
 }
开发者ID:Cyberbanan,项目名称:voxeliq,代码行数:7,代码来源:MacOSPlatform.cs


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


示例10: FinishedLaunching

		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
		{
			using (RolePlayingGame game = new RolePlayingGame())
			{
				game.Run();
			}
		}
开发者ID:EuropeanMac,项目名称:MonoGame-Samples,代码行数:7,代码来源:Program.cs


示例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 (); };
		}
开发者ID:gabfr,项目名称:MonoMac.Windows.Form,代码行数:7,代码来源:ApplicationContext.cs


示例12: IsSelectorExcludedFromWebScript

        public static bool IsSelectorExcludedFromWebScript(MonoMac.ObjCRuntime.Selector aSelector)
        {
            if (aSelector.Name == "callFromJs")
                return false;

            return true; // Запрещаем вызов всех остальных методов
        }
开发者ID:jacob-l,项目名称:Browser,代码行数:7,代码来源:MainWindowController.cs


示例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);

		}
开发者ID:Anomalous-Software,项目名称:monomac,代码行数:30,代码来源:MainWindow.cs


示例14: FinishedLaunching

        public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
        {
            CCApplication application = new CCApplication ();
            application.ApplicationDelegate = new GameAppDelegate ();

            application.StartGame ();
        }
开发者ID:netonjm,项目名称:CSExtensionKit,代码行数:7,代码来源:AppDelegate.cs


示例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);
 }
开发者ID:sbaer,项目名称:cocoarhino_cs,代码行数:8,代码来源:CocoaRhinoCommand.cs


示例16: AudioGraphEventArgs

	    public AudioGraphEventArgs(AudioUnitRenderActionFlags actionFlags,
				       MonoMac.AudioToolbox.AudioTimeStamp timeStamp,
				       int busNumber,
				       int numberFrames,
				       AudioBufferList data)
		    : base(actionFlags, timeStamp, busNumber, numberFrames, data)
	    {
	    }
开发者ID:Anomalous-Software,项目名称:maccore,代码行数:8,代码来源:AudioGraphEventArgs.cs


示例17: WindowShouldClose

		public override bool WindowShouldClose (MonoMac.Foundation.NSObject sender)
		{
			return true; // 2.8, in previous versions closing the main window will close the App
			/*
			m_main.Shutdown ();
			return false;
			*/
		}
开发者ID:liftir,项目名称:airvpn-client,代码行数:8,代码来源:MainWindowDelegate.cs


示例18: powerStateChanged

		partial void powerStateChanged (MonoMac.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);
		}
开发者ID:RafasTavares,项目名称:mac-samples,代码行数:8,代码来源:MainWindowController.cs


示例19: DoCommandBySelector

 public override bool DoCommandBySelector(NSControl control, NSTextView textView, MonoMac.ObjCRuntime.Selector commandSelector)
 {
     if (control != null && "insertNewline:".Equals(commandSelector.Name))
     {
         onEnterPressed(control);
         return true;
     }
     return false;
 }
开发者ID:muranoya,项目名称:MonoMacChat,代码行数:9,代码来源:MyNSTextFieldDelegate.cs


示例20: _AudioConverterEventArgs

 public _AudioConverterEventArgs(
     uint _NumberDataPackets,
     AudioBufferList _Data,
     MonoMac.AudioToolbox.AudioStreamPacketDescription[] _DataPacketDescription)
 {
     NumberDataPackets = _NumberDataPackets;
     Data = _Data;
     DataPacketDescription = _DataPacketDescription;
 }
开发者ID:jorik041,项目名称:maccore,代码行数:9,代码来源:_AudioConverterEventArgs.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MonoTextEditor类代码示例发布时间:2022-05-24
下一篇:
C# MonoIOError类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap