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


C# CallbackArgs.SetParameter方法代码示例

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


在下文中一共展示了CallbackArgs.SetParameter方法的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: GetPropertyCallBack1

        private static void GetPropertyCallBack1(object caller, CallbackArgs arguments)
        {
            if ((int)arguments.GetParameter(0) == (int)__VSSPROPID.VSSPROPID_IsInCommandLineMode)
            {
                arguments.SetParameter(1, true);
                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: GetLineTextCallbackForConsoleTextOfLine

        private static void GetLineTextCallbackForConsoleTextOfLine(object sender, CallbackArgs args)
        {
            BaseMock mock = (BaseMock)sender;
            int expectedLine = (int)mock["ExpectedLine"];
            Assert.IsTrue(expectedLine == (int)args.GetParameter(0));
            Assert.IsTrue(expectedLine == (int)args.GetParameter(2));

            int expectedStart = (int)mock["ExpectedStart"];
            Assert.IsTrue(expectedStart == (int)args.GetParameter(1));

            int expectedEnd = (int)mock["ExpectedEnd"];
            Assert.IsTrue(expectedEnd == (int)args.GetParameter(3));

            args.SetParameter(4, (string)mock["LineText"]);

            args.ReturnValue = Microsoft.VisualStudio.VSConstants.S_OK;
        }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:17,代码来源:ConsoleWindowTest.cs

示例10: ShowMessageBoxYes

 private static void ShowMessageBoxYes(object caller, CallbackArgs arguments)
 {
     arguments.SetParameter(10, (int)DialogResult.Yes);
     arguments.ReturnValue = VSConstants.S_OK;
 }
开发者ID:rsweeney21,项目名称:VisualGit,代码行数:5,代码来源:MockUiShellProvider.cs

示例11: NextCallBack0

 private static void NextCallBack0(object caller, CallbackArgs arguments)
 {
     arguments.ReturnValue = VSConstants.S_FALSE;
     arguments.SetParameter(2, (uint)0);
 }
开发者ID:rsweeney21,项目名称:VisualGit,代码行数:5,代码来源:MockUiShellProvider.cs

示例12: GetLocalRegistryRoot

 private static void GetLocalRegistryRoot(object caller, CallbackArgs arguments)
 {
     // this is required for fetch MSBuildPath key value
     arguments.SetParameter(0, @"SOFTWARE\Microsoft\VisualStudio\9.0"); // pbstrRoot
     arguments.ReturnValue = VSConstants.S_OK;
 }
开发者ID:tunnelvisionlabs,项目名称:MPFProj10,代码行数:6,代码来源:MockServicesProvider.cs

示例13: FindAndLockDocumentCallBack

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

            arguments.SetParameter(2, null);        //setting IVsHierarchy
            arguments.SetParameter(3, (uint)1);           //Setting itemID
            arguments.SetParameter(4, IntPtr.Zero); //Setting DocData
            arguments.SetParameter(5, (uint)1);           //Setting docCookie
        }
开发者ID:tunnelvisionlabs,项目名称:MPFProj10,代码行数:9,代码来源:MockServicesProvider.cs

示例14: GetPropertiesCallBack

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

            // Find the corresponding property
            object propertyID = arguments.GetParameter(0);
            Dictionary<int, object> properties = (Dictionary<int, object>)((BaseMock)caller)[propertiesName];
            object propertyValue = null;
            if (properties != null && propertyID != null)
                propertyValue = properties[(int)propertyID];
            // Set the value we ended up with as the return value
            arguments.SetParameter(1, propertyValue);
        }
开发者ID:jradxl,项目名称:All-In-One-Framework-VS2012,代码行数:13,代码来源:MockWindowFrameProvider.cs

示例15: GetLocalRegistryRoot

 private static void GetLocalRegistryRoot(object caller, CallbackArgs arguments)
 {
     arguments.SetParameter(0, @"SOFTWARE\Microsoft\VisualStudio\9.0");
     arguments.ReturnValue = VSConstants.S_OK;
 }
开发者ID:tunnelvisionlabs,项目名称:MPFProj10,代码行数:5,代码来源:MockILocalRegistry.cs


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