本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: SourceFilesCallBack
private static void SourceFilesCallBack(object caller, CallbackArgs arguments)
{
BaseMock compiler = (BaseMock)caller;
compiler["SourceFiles"] = arguments.GetParameter(0);
}
示例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;
}
示例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;
}
示例13: OutputAssemblyCallBack
private static void OutputAssemblyCallBack(object caller, CallbackArgs arguments)
{
BaseMock compiler = (BaseMock)caller;
compiler["OutputAssembly"] = arguments.GetParameter(0);
}
示例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;
}
示例15: SetEngineStdOut
private static void SetEngineStdOut(object sender, CallbackArgs args)
{
BaseMock mock = (BaseMock)sender;
mock["StdOut"] = args.GetParameter(0);
}