本文整理汇总了C#中MObjc.NSObject类的典型用法代码示例。如果您正苦于以下问题:C# NSObject类的具体用法?C# NSObject怎么用?C# NSObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NSObject类属于MObjc命名空间,在下文中一共展示了NSObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: clear
public void clear(NSObject sender)
{
NSDocumentController.sharedDocumentController().clearRecentDocuments(this);
DoReload();
m_table.reloadData();
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:7,代码来源:BrowseRecentFilesController.cs
示例2: Init
public void Init()
{
AssertListener.Install();
Registrar.CanInit = true;
m_pool = new NSObject(NSObject.AllocAndInitInstance("NSAutoreleasePool"));
}
开发者ID:afrog33k,项目名称:mobjc,代码行数:7,代码来源:TimingTest.cs
示例3: Main
internal static void Main(string[] args)
{
try
{
Registrar.CanInit = true;
// Make our app a foreground app (this is redundant if we were started via the
// Finder or the open command, but important if we were started by directly
// executing the launcher script).
var psn = new ProcessSerialNumber();
psn.highLongOfPSN = 0;
psn.lowLongOfPSN = kCurrentProcess;
int err = TransformProcessType(ref psn, kProcessTransformToForegroundApplication);
if (err != 0)
throw new InvalidOperationException("TransformProcessType returned " + err + ".");
err = SetFrontProcess(ref psn);
if (err != 0)
throw new InvalidOperationException("SetFrontProcess returned " + err + ".");
// Load the nib and run the main event loop.
NSObject pool = new NSObject(NSObject.AllocAndInitInstance("NSAutoreleasePool"));
App app = new App("MainMenu.nib");
pool.release();
app.Run();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
开发者ID:afrog33k,项目名称:mobjc,代码行数:33,代码来源:Program.cs
示例4: pressedOK
public void pressedOK(NSObject sender)
{
Unused.Value = sender;
NSApplication.sharedApplication().stopModalWithCode(Enums.NSOKButton);
window().orderOut(this);
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:7,代码来源:GetTextController.cs
示例5: addDir
public void addDir(NSObject sender)
{
NSOpenPanel panel = NSOpenPanel.openPanel();
panel.setCanChooseFiles(false);
panel.setCanChooseDirectories(true);
panel.setAllowsMultipleSelection(true);
panel.setCanCreateDirectories(false);
int result = panel.runModalForDirectory_file_types(null, null, null);
if (result == Enums.NSOKButton && panel.filenames().count() > 0)
{
NSMutableArray dirs = NSMutableArray.Create();
NSUserDefaults defaults = NSUserDefaults.standardUserDefaults();
dirs.addObjectsFromArray(defaults.arrayForKey(NSString.Create("default find directories")));
foreach (NSString path in panel.filenames())
{
if (!dirs.containsObject(path))
dirs.addObject(path);
}
defaults.setObject_forKey(dirs, NSString.Create("default find directories"));
m_find.AddDefaultDirs();
}
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:26,代码来源:FindInFilesOptionsController.cs
示例6: NSBeginInformationalAlertSheet
public static void NSBeginInformationalAlertSheet(NSString title, NSString defaultButton, NSString alternateButton, NSString otherButton, NSWindow docWindow, NSObject modalDelegate, string didEndSelector, string didDismissSelector, IntPtr contextInfo, NSString message)
{
Selector endSelector = didEndSelector != null ? new Selector(didEndSelector) : null;
Selector dismissSelector = didDismissSelector != null ? new Selector(didDismissSelector) : null;
NativeMethods.NSBeginInformationalAlertSheet(title, defaultButton, alternateButton, otherButton, docWindow, modalDelegate, endSelector, dismissSelector, contextInfo, message);
}
开发者ID:afrog33k,项目名称:mcocoa,代码行数:7,代码来源:Functions.cs
示例7: memoryTest
public void memoryTest(NSObject sender)
{
lock (m_lock)
{
if (m_checkingMemory)
{
m_checkingMemory = false;
Monitor.PulseAll(m_lock);
m_thread1 = null;
m_thread2 = null;
}
else
{
NSObject app = (NSObject) new Class("NSApplication").Call("sharedApplication");
NSObject window = (NSObject) app.Call("mainWindow");
NSObject content = (NSObject) window.Call("contentView");
NSObject view = (NSObject) content.Call("viewWithTag:", 33);
if (!view.IsNil())
{
m_thread1 = new Thread(this.DoDumpStatsThread);
m_thread1.Start();
m_thread2 = new Thread(this.DoMemoryThread);
m_thread2.Start(view);
m_checkingMemory = true;
}
else
Console.WriteLine("Couldn't find the simple layout view.");
}
}
}
开发者ID:afrog33k,项目名称:mobjc,代码行数:34,代码来源:DebugController.cs
示例8: removeLastBox
public void removeLastBox(NSObject sender)
{
NSObject last = Subviews.LastObject().To<NSObject>();
last.Call("removeFromSuperview");
DoLayout();
}
开发者ID:afrog33k,项目名称:mobjc,代码行数:7,代码来源:SimpleLayoutView.cs
示例9: generatePressed
public void generatePressed(NSObject sender)
{
Generate = true;
NSApplication.sharedApplication().stopModalWithCode(Enums.NSOKButton);
window().orderOut(this);
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:7,代码来源:FindBuildScriptController.cs
示例10: replaceAndFind
public void replaceAndFind(NSObject sender)
{
Unused.Value = sender;
OnUpdateLists();
Finder.ReplaceAndFind();
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:7,代码来源:FindController.cs
示例11: next
public void next(NSObject sender)
{
Unused.Value = sender;
OnUpdateLists();
Finder.FindNext();
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:7,代码来源:FindController.cs
示例12: ArrayArg
public void ArrayArg()
{
NSObject pool = new NSObject(NSObject.AllocAndInitInstance("NSAutoreleasePool"));
Class nsData = new Class("NSData");
long bytes = DoGetMemory();
for (int j = 1; j < 100; ++j)
{
for (int i = 0; i < NumIterations/100; ++i)
{
byte[] data = new byte[]{2, 5, 6, 3};
NSObject d = new NSObject(nsData.Call("alloc"));
NSObject e = (NSObject) d.Call("initWithBytes:length:", data, data.Length);
e.release();
}
GC.Collect();
}
pool.release();
GC.Collect();
GC.WaitForPendingFinalizers();
long delta = DoGetMemory() - bytes;
if (delta/NumIterations > 4)
Assert.Fail("ArrayArg used {0}K of memory ({1} bytes per iteration)!", delta/1024, delta/NumIterations);
}
开发者ID:afrog33k,项目名称:mobjc,代码行数:27,代码来源:MemoryTests.cs
示例13: cancelPressed
public void cancelPressed(NSObject sender)
{
Unused.Value = sender;
NSApplication.sharedApplication().endSheet(m_sheet.Value);
m_sheet.Value.orderOut(this);
m_dir = null;
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:8,代码来源:DirPrefsController.cs
示例14: applicationWillTerminate
public void applicationWillTerminate(NSObject notification)
{
#if DEBUG
// These are fairly expensive to create and it's easy to mess up and
// create tons inside loops so we'll print the count here.
Console.WriteLine("{0} BigFloat instances were created.", BigFloat.InstanceCount);
#endif
}
开发者ID:afrog33k,项目名称:mcocoa,代码行数:8,代码来源:AppDelegate.cs
示例15: flagsCancel
public void flagsCancel(NSObject sender)
{
Unused.Value = sender;
NSApplication.sharedApplication().stopModal();
window().orderOut(this);
window().release();
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:8,代码来源:FlagsController.cs
示例16: addABox
// Action methods to add/remove boxes, giving us something to animate. Note that we
// cause a relayout here; a better design is to relayout in the view automatically on
// addition/removal of subviews.
public void addABox(NSObject sender)
{
NSObject box = DoNewBox();
AddSubView(box);
box.release();
DoLayout();
}
开发者ID:afrog33k,项目名称:mobjc,代码行数:11,代码来源:SimpleLayoutView.cs
示例17: pressedCancel
public void pressedCancel(NSObject sender)
{
Unused.Value = sender;
NSApplication.sharedApplication().stopModalWithCode(Enums.NSCancelButton);
window().orderOut(this);
Text = string.Empty;
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:9,代码来源:GetTextController.cs
示例18: doubleClicked
public void doubleClicked(NSObject sender)
{
int row = m_table.selectedRow();
row = m_stack.Length - row - 1; // frames are drawn top down
m_selected = row;
m_table.reloadData();
Broadcaster.Invoke("changed stack frame", m_stack[row]);
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:9,代码来源:StackController.cs
示例19: setDefaultColor
public void setDefaultColor(NSObject sender)
{
NSColor color = sender.Call("color").To<NSColor>();
NSUserDefaults defaults = NSUserDefaults.standardUserDefaults();
NSData data = NSArchiver.archivedDataWithRootObject(color);
defaults.setObject_forKey(data, NSString.Create("text default color"));
Broadcaster.Invoke("text default color changed", null);
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:10,代码来源:PreferencesController.cs
示例20: removeDirs
public void removeDirs(NSObject sender)
{
NSIndexSet selections = m_dirsTable.Value.selectedRowIndexes();
NSMutableArray dirs = NSMutableArray.Create();
NSUserDefaults defaults = NSUserDefaults.standardUserDefaults();
dirs.addObjectsFromArray(defaults.arrayForKey(NSString.Create("default find directories")));
dirs.removeObjectsAtIndexes(selections);
defaults.setObject_forKey(dirs, NSString.Create("default find directories"));
}
开发者ID:andyhebear,项目名称:Continuum,代码行数:10,代码来源:FindInFilesOptionsController.cs
注:本文中的MObjc.NSObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论