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


C# CallbackArgs.GetParameter方法代码示例

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


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

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

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

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

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

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

 private static void ReplaceLinesCallback(object sender, CallbackArgs args)
 {
     Assert.IsTrue(11 == (int)args.GetParameter(0));
     Assert.IsTrue(42 == (int)args.GetParameter(1));
     Assert.IsTrue(11 == (int)args.GetParameter(2));
     Assert.IsTrue(42 == (int)args.GetParameter(3));
     IntPtr stringPointer = (IntPtr)args.GetParameter(4);
     int stringLen = (int)args.GetParameter(5);
     Assert.IsTrue(IntPtr.Zero != stringPointer);
     Assert.IsTrue(stringLen > 0);
     string newText = Marshal.PtrToStringAuto(stringPointer, stringLen);
     BaseMock mock = (BaseMock)sender;
     mock["Text"] = (string)mock["Text"] + newText;
     args.ReturnValue = Microsoft.VisualStudio.VSConstants.S_OK;
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:15,代码来源:TextBufferStreamTest.cs

示例7: CreateMarkerCallback

 private static void CreateMarkerCallback(object sender, CallbackArgs args)
 {
     BaseMock mock = (BaseMock)sender;
     IVsTextLineMarker[] markers = (IVsTextLineMarker[])args.GetParameter(6);
     BaseMock markerMock = (BaseMock)mock["LineMarker"];
     TextSpan span = new TextSpan();
     span.iStartLine = (int)args.GetParameter(1);
     span.iStartIndex = (int)args.GetParameter(2);
     span.iEndLine = (int)args.GetParameter(3);
     span.iEndIndex = (int)args.GetParameter(4);
     markerMock["Span"] = span;
     markers[0] = (IVsTextLineMarker)markerMock;
     args.ReturnValue = Microsoft.VisualStudio.VSConstants.S_OK;
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:14,代码来源:MockFactories.cs

示例8: StandardMarkerResetSpanCallback

 private static void StandardMarkerResetSpanCallback(object sender, CallbackArgs args)
 {
     BaseMock mock = (BaseMock)sender;
     TextSpan span = new TextSpan();
     span.iStartLine = (int)args.GetParameter(0);
     span.iStartIndex = (int)args.GetParameter(1);
     span.iEndLine = (int)args.GetParameter(2);
     span.iEndIndex = (int)args.GetParameter(3);
     mock["Span"] = span;
     args.ReturnValue = Microsoft.VisualStudio.VSConstants.S_OK;
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:11,代码来源:MockFactories.cs

示例9: OutputStringCallback

 private static void OutputStringCallback(object sender, CallbackArgs args)
 {
     BaseMock mock = (BaseMock)sender;
     System.Text.StringBuilder builder = (System.Text.StringBuilder)mock["StringBuilder"];
     string text = (string)args.GetParameter(0);
     builder.Append(text);
     args.ReturnValue = 0;
 }
开发者ID:ldematte,项目名称:BlenXVSP,代码行数:8,代码来源:MockFactories.cs

示例10: SourceFilesCallBack

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

示例11: GetSelectedItemsCallback

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

            // Get the arguments
            uint grfGSI = (uint)arguments.GetParameter(0);
            uint cRequestedItems = (uint)arguments.GetParameter(1);
            VSITEMSELECTION[] rgItemSel = (VSITEMSELECTION[])arguments.GetParameter(2);

            if (selection == null && cRequestedItems > 0 ||
                selection.Length < cRequestedItems)
            {
                arguments.ReturnValue = VSConstants.E_INVALIDARG;
                return;
            }

            for (int i = 0; i< cRequestedItems; i++)
            {
                rgItemSel[i].itemid = selection[i].itemid;
                if ((grfGSI & (uint)__VSGSIFLAGS.GSI_fOmitHierPtrs) == 0)
                {
                    rgItemSel[i].pHier = selection[i].pHier;
                }
            }

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

示例12: TextViewInitializeCallback

 private static void TextViewInitializeCallback(object sender, CallbackArgs args)
 {
     BaseMock mock = (BaseMock)sender;
     // Verify that the view is sited and that a text buffer is provided.
     Assert.IsTrue(1 == mock.FunctionCalls(string.Format("{0}.{1}", typeof(IObjectWithSite), "SetSite")));
     IVsTextLines textLines = args.GetParameter(0) as IVsTextLines;
     Assert.IsNotNull(textLines);
     // This text view is not supposed to be initialized using a parent window.
     Assert.IsTrue(IntPtr.Zero == (IntPtr)args.GetParameter(1));
     args.ReturnValue = Microsoft.VisualStudio.VSConstants.S_OK;
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:11,代码来源:ConsoleWindowTest.cs

示例13: OutputAssemblyCallBack

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

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

示例15: SetEngineStdOut

 private static void SetEngineStdOut(object sender, CallbackArgs args)
 {
     BaseMock mock = (BaseMock)sender;
     mock["StdOut"] = args.GetParameter(0);
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:5,代码来源:ConsoleWindowTest.cs


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