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


C# Id.SendMessage方法代码示例

本文整理汇总了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;
        }
开发者ID:Monobjc,项目名称:monobjc-samples,代码行数:23,代码来源:ExecutableArchitectureTransformer.cs

示例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);
        }
开发者ID:Monobjc,项目名称:monobjc-samples,代码行数:16,代码来源:MyPDFDocument.cs

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

示例4: ChangeLayout

partial         void ChangeLayout(Id sender)
        {
            this.LayoutStyle = (LayoutStyle) sender.SendMessage<int>("selectedTag");
        }
开发者ID:Monobjc,项目名称:monobjc-samples,代码行数:4,代码来源:SimpleLayoutView.cs

示例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));
 }
开发者ID:Monobjc,项目名称:monobjc-samples,代码行数:12,代码来源:FindPanelLayoutAppDelegate.cs

示例6: transformedValue

        public Id transformedValue(Id value)
        {
            bool b = value.SendMessage<bool>("boolValue");

            return b ? YES : NO;
        }
开发者ID:Monobjc,项目名称:monobjc-samples,代码行数:6,代码来源:BooleanTransformer.cs


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