本文整理汇总了C#中Id.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Id.SendMessage方法的具体用法?C# Id.SendMessage怎么用?C# Id.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Id
的用法示例。
在下文中一共展示了Id.SendMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: transformedValue
public Id transformedValue(Id value)
{
NSString archStr;
switch (value.SendMessage<NSMachOArchitecture>("intValue"))
{
case NSMachOArchitecture.NSBundleExecutableArchitectureI386:
archStr = @"Intel 32-bit";
break;
case NSMachOArchitecture.NSBundleExecutableArchitectureX86_64:
archStr = @"Intel 64-bit";
break;
case NSMachOArchitecture.NSBundleExecutableArchitecturePPC:
// in case of Rosetta, allow for PPC
archStr = @"PPC Translated";
break;
default:
archStr = @"unknown";
break;
}
return archStr;
}
示例2: DoFind
partial void DoFind(Id sender)
{
if (this._pdfView.Document.IsFinding)
{
this._pdfView.Document.CancelFindString();
}
// Lazily allocate _searchResults.
if (this._searchResults == null)
{
this._searchResults = NSMutableArray.ArrayWithCapacity(10).Retain<NSMutableArray>();
}
NSString value = sender.SendMessage<NSString>("stringValue");
this._pdfView.Document.BeginFindStringWithOptions(value, (int) NSStringCompareOptions.NSCaseInsensitiveSearch);
}
示例3: SwitchView
partial void SwitchView(Id sender)
{
// Figure out the new view, the old view, and the new size of the window
int tag = sender.SendMessage<int>("tag");
NSView view = this.ViewForTag(tag);
NSView previousView = this.ViewForTag(this.currentViewTag);
this.currentViewTag = tag;
NSRect newFrame = this.NewFrameForNewContentView(view);
// Using an animation grouping because we may be changing the duration
NSAnimationContext.BeginGrouping();
// With the shift key down, do slow-mo animation
if ((NSApplication.NSApp.CurrentEvent.ModifierFlags & NSModifierFlags.NSShiftKeyMask) == NSModifierFlags.NSShiftKeyMask)
{
NSAnimationContext.CurrentContext.Duration = 1.0f;
}
// Call the animator instead of the view / window directly
this.Window.ContentView.Animator.ReplaceSubviewWith(previousView, view);
this.Window.Animator.SetFrameDisplay(newFrame, true);
NSAnimationContext.EndGrouping();
}
示例4: ChangeLayout
partial void ChangeLayout(Id sender)
{
this.LayoutStyle = (LayoutStyle) sender.SendMessage<int>("selectedTag");
}
示例5: ShuffleTitleOfSender
public void ShuffleTitleOfSender(Id sender)
{
NSArray strings = NSArray.ArrayWithObjects ((NSString)"S", (NSString)"Short", (NSString)"Absolutely ginormous string (for a button)", null);
NSInteger previousStringIndex = strings.IndexOfObject (sender.SendMessage<NSString> ("title"));
NSInteger nextStringIndex;
if (previousStringIndex == NSUInteger.NSNotFound) {
nextStringIndex = 0;
} else {
nextStringIndex = (previousStringIndex + 1) % 3;
}
sender.SendMessage ("setTitle:", strings.ObjectAtIndex (nextStringIndex));
}
示例6: transformedValue
public Id transformedValue(Id value)
{
bool b = value.SendMessage<bool>("boolValue");
return b ? YES : NO;
}