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


C# UnitTestLibrary.CallbackArgs类代码示例

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


CallbackArgs类属于Microsoft.VsSDK.UnitTestLibrary命名空间,在下文中一共展示了CallbackArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCurrentSelectionCallback

        private static void GetCurrentSelectionCallback(object caller, CallbackArgs arguments)
        {
            // Read the current selection data
            VSITEMSELECTION[] selection = (VSITEMSELECTION[])((BaseMock)caller)["Selection"];

            // Initialize output parameters for empty selection
            arguments.SetParameter(0, IntPtr.Zero);                 // hierarchyPtr
            arguments.SetParameter(1, VSConstants.VSITEMID_NIL);    // itemid
            arguments.SetParameter(2, null);                        // multiItemSelect
            arguments.SetParameter(3, IntPtr.Zero);                 // selectionContainer

            if (selection != null)
            {
                if (selection.Length == 1)
                {
                    if (selection[0].pHier != null)
                    {
                        IntPtr ptrHier = Marshal.GetComInterfaceForObject(selection[0].pHier, typeof(IVsHierarchy));
                        arguments.SetParameter(0, ptrHier);                // hierarchyPtr
                    }
                    arguments.SetParameter(1, selection[0].itemid);    // itemid
                }
                else
                {
                    // Multiple selection, return IVsMultiItemSelect interface
                    arguments.SetParameter(1, VSConstants.VSITEMID_SELECTION);    // itemid
                    arguments.SetParameter(2, caller as IVsMultiItemSelect);      // multiItemSelect
                }
            }

            arguments.ReturnValue = VSConstants.S_OK;
        }
开发者ID:rsweeney21,项目名称:VisualGit,代码行数:32,代码来源:MockIVsMonitorSelection.cs

示例2: OutputWindowPaneCallback

 private void OutputWindowPaneCallback(object sender, CallbackArgs args) {
     callbackExecuted = true;
     string expectedText = "Global SrcML Service Function called.\n";
     string inputText = (string)args.GetParameter(0);
     Assert.AreEqual(expectedText, inputText, "OutputString called with wrong text.");
     args.ReturnValue = 0;
 }
开发者ID:nkcsgexi,项目名称:SrcML.NET,代码行数:7,代码来源:SrcMLGlobalServiceTests.cs

示例3: CreateToolWindowNegativeTestCallBack

        private static void CreateToolWindowNegativeTestCallBack(object caller, CallbackArgs arguments)
        {
            arguments.ReturnValue = VSConstants.S_OK;

            //set the windowframe object to null
            arguments.SetParameter(9, null);
        }
开发者ID:Rwing,项目名称:git-tools,代码行数:7,代码来源:UIShellServiceMock.cs

示例4: CreateInstanceCallBack

 private static void CreateInstanceCallBack(object caller, CallbackArgs arguments)
 {
     // Create the output mock object for the frame
     IVsTextLines textLines = (IVsTextLines)GetIVsTextLinesInstance();
     ///GCHandle handle = GCHandle.Alloc(textLines);
     arguments.SetParameter(4, Marshal.GetComInterfaceForObject(textLines, typeof(IVsTextLines)));
     arguments.ReturnValue = VSConstants.S_OK;
 }
开发者ID:ZinkoSoft,项目名称:NuSet,代码行数:8,代码来源:LocalRegistryServiceMock.cs

示例5: CreateToolWindowCallBack

        private static void CreateToolWindowCallBack(object caller, CallbackArgs arguments)
        {
            arguments.ReturnValue = VSConstants.S_OK;

            // Create the output mock object for the frame
            IVsWindowFrame frame = WindowFrameMock.GetBaseFrame();
            arguments.SetParameter(9, frame);
        }
开发者ID:Rwing,项目名称:git-tools,代码行数:8,代码来源:UIShellServiceMock.cs

示例6: GetPropertyCallBack2

        private static void GetPropertyCallBack2(object caller, CallbackArgs arguments)
        {
            if ((int)arguments.GetParameter(0) == (int)__VSSPROPID.VSSPROPID_IsInCommandLineMode)
            {
                arguments.SetParameter(1, false);
                arguments.ReturnValue = VSConstants.S_OK;
                return;
            }

            arguments.ReturnValue = VSConstants.E_NOTIMPL;
        }
开发者ID:rsweeney21,项目名称:VisualGit,代码行数:11,代码来源:MockShellProvider.cs

示例7: GetPropertyCallBack

        private static void GetPropertyCallBack(object caller, CallbackArgs arguments)
        {
            __VSSPROPID propertyID = (__VSSPROPID)arguments.GetParameter(0);

            switch(propertyID)
            {
                case __VSSPROPID.VSSPROPID_IsInCommandLineMode:
                    arguments.SetParameter(1, true);
                    break;
                default:
                    break;
            }

            arguments.ReturnValue = VSConstants.S_OK;
        }
开发者ID:tunnelvisionlabs,项目名称:MPFProj10,代码行数:15,代码来源:MockIVsShell.cs

示例8: ReadCallback

        private static void ReadCallback(object caller, CallbackArgs arguments)
        {
            string propertyName = (string)arguments.GetParameter(0);
            if (propertyName == strSolutionControlledProperty)
            {
                arguments.SetParameter(1, true);
                arguments.ReturnValue = VSConstants.S_OK;
                return;
            }
            else if (propertyName == strSolutionBindingsProperty)
            {
                arguments.SetParameter(1, "Solution's location");
                arguments.ReturnValue = VSConstants.S_OK;
                return;
            }

            arguments.ReturnValue = VSConstants.E_NOTIMPL;
        }
开发者ID:rsweeney21,项目名称:VisualGit,代码行数:18,代码来源:MockPropertyBag.cs

示例9: FindConnectionPointCallback

 private static void FindConnectionPointCallback(object sender, CallbackArgs args)
 {
     BaseMock mock = (BaseMock)sender;
     Dictionary<Guid, IConnectionPoint> connectionPoints =
         (Dictionary<Guid, IConnectionPoint>)mock[connectionPointsCollection];
     Guid eventGuid = (Guid)args.GetParameter(0);
     IConnectionPoint connectionPoint;
     if (!connectionPoints.TryGetValue(eventGuid, out connectionPoint))
     {
         // This container does not contain a connection point for this event type,
         // so set the out parameter to null and return an error.
         args.SetParameter(1, null);
         args.ReturnValue = Microsoft.VisualStudio.VSConstants.E_NOINTERFACE;
         return;
     }
     // The connection point is handled.
     args.SetParameter(1, connectionPoint);
     args.ReturnValue = Microsoft.VisualStudio.VSConstants.S_OK;
 }
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:19,代码来源:ConnectionPointHelper.cs

示例10: GetToolWindowEnumCallBack2

        private static void GetToolWindowEnumCallBack2(object caller, CallbackArgs arguments)
        {
            arguments.ReturnValue = VSConstants.S_OK;

            // Create the output mock object
            if (enumWindowsFactory2 == null)
                enumWindowsFactory2 = new GenericMockFactory("EnumWindows2", new Type[] { typeof(IEnumWindowFrames) });
            BaseMock enumWindows = enumWindowsFactory2.GetInstance();
            // Add support for Next
            string name = string.Format("{0}.{1}", typeof(IEnumWindowFrames).FullName, "Next");
            enumWindows.AddMethodCallback(name, new EventHandler<CallbackArgs>(NextCallBack2));
            windowCount = 0;

            arguments.SetParameter(0, enumWindows);
        }
开发者ID:rsweeney21,项目名称:VisualGit,代码行数:15,代码来源:MockUiShellProvider.cs

示例11: CreateToolWindowCallBack

        private static void CreateToolWindowCallBack(object caller, CallbackArgs arguments)
        {
            arguments.ReturnValue = VSConstants.S_OK;

            // Create the output mock object for the frame
            IVsWindowFrame frame = MockWindowFrameProvider.GetBaseFrame();
            arguments.SetParameter(9, frame);

            // The window pane (if one is provided) needs to be sited
            IVsWindowPane pane = arguments.GetParameter(2) as IVsWindowPane;
            if (pane != null)
            {
                // Create a service provider to site the window pane
                OleServiceProvider serviceProvider = OleServiceProvider.CreateOleServiceProviderWithBasicServices();
                // It needs to provide STrackSelection
                GenericMockFactory trackSelectionFactory = MockWindowFrameProvider.TrackSelectionFactory;
                serviceProvider.AddService(typeof(STrackSelection), trackSelectionFactory.GetInstance(), false);
                // Add support for output window
                serviceProvider.AddService(typeof(SVsOutputWindow), new OutputWindowService(), false);
                // Finally we need support for FindToolWindow
                serviceProvider.AddService(typeof(SVsUIShell), GetWindowEnumerator0(), false);

                pane.SetSite(serviceProvider);
            }
        }
开发者ID:rsweeney21,项目名称:VisualGit,代码行数:25,代码来源:MockUiShellProvider.cs

示例12: ShowMessageBoxCallBack

 private static void ShowMessageBoxCallBack(object caller, CallbackArgs arguments)
 {
     arguments.ReturnValue = VSConstants.S_OK;
     arguments.SetParameter(10, (int)System.Windows.Forms.DialogResult.Yes);
 }
开发者ID:ZapMyR,项目名称:UnityEvaluation,代码行数:5,代码来源:UIShellServiceMock.cs

示例13: SetWaitCursorCallBack

 private static void SetWaitCursorCallBack(object caller, CallbackArgs arguments)
 {
     arguments.ReturnValue = VSConstants.S_OK;
 }
开发者ID:ZapMyR,项目名称:UnityEvaluation,代码行数:4,代码来源:UIShellServiceMock.cs

示例14: SaveDocDataToFileCallBack

 private static void SaveDocDataToFileCallBack(object caller, CallbackArgs arguments)
 {
     arguments.ReturnValue = VSConstants.S_OK;
 }
开发者ID:ZapMyR,项目名称:UnityEvaluation,代码行数:4,代码来源:UIShellServiceMock.cs

示例15: IncludeDebugInformationCallBack

 private static void IncludeDebugInformationCallBack(object caller, CallbackArgs arguments)
 {
     BaseMock compiler = (BaseMock)caller;
     compiler["IncludeDebugInformation"] = arguments.GetParameter(0);
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:5,代码来源:IronPythonCompilerTaskTest.cs


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