本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
示例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: 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;
}
示例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;
}
示例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;
}
示例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;
}
示例10: ShowMessageBoxYes
private static void ShowMessageBoxYes(object caller, CallbackArgs arguments)
{
arguments.SetParameter(10, (int)DialogResult.Yes);
arguments.ReturnValue = VSConstants.S_OK;
}
示例11: NextCallBack0
private static void NextCallBack0(object caller, CallbackArgs arguments)
{
arguments.ReturnValue = VSConstants.S_FALSE;
arguments.SetParameter(2, (uint)0);
}
示例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;
}
示例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
}
示例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);
}
示例15: GetLocalRegistryRoot
private static void GetLocalRegistryRoot(object caller, CallbackArgs arguments)
{
arguments.SetParameter(0, @"SOFTWARE\Microsoft\VisualStudio\9.0");
arguments.ReturnValue = VSConstants.S_OK;
}