private void ChangeSelection(object selectionObject, Microsoft.ManagementConsole.Internal.SelectionCardinality type, Guid[] uniqueNodeTypes, WritableSharedData sharedData)
{
switch (type)
{
case Microsoft.ManagementConsole.Internal.SelectionCardinality.None:
if (uniqueNodeTypes.Length > 0)
{
throw Microsoft.ManagementConsole.Internal.Utility.CreateArgumentOutOfRangeException("uniqueNodeTypes.Length", uniqueNodeTypes.Length, 0, 0);
}
break;
case Microsoft.ManagementConsole.Internal.SelectionCardinality.Single:
if (uniqueNodeTypes.Length > 1)
{
throw Microsoft.ManagementConsole.Internal.Utility.CreateArgumentOutOfRangeException("uniqueNodeTypes.Length", uniqueNodeTypes.Length, 0, 1);
}
break;
}
this._id = this.GetSelectionId(type, selectionObject);
if (sharedData == null)
{
sharedData = new WritableSharedData();
}
this._type = type;
this._uniqueNodeTypes = uniqueNodeTypes;
this.ReplaceSharedData(sharedData);
this._selectionObject = selectionObject;
this.ValidateVerbs();
if (this._view.Initialized)
{
this._view.OnSelectionContextChanged(this._id, this._type, this._uniqueNodeTypes, this._sharedData.GetItems());
}
ScopeNode scopeNode = this._view.ScopeNode;
if (scopeNode != null)
{
scopeNode.CurrentSelectionDatas[this._view] = new AuxiliarySelectionData(this);
}
}