本文整理汇总了C#中__VSDELETEITEMOPERATION类的典型用法代码示例。如果您正苦于以下问题:C# __VSDELETEITEMOPERATION类的具体用法?C# __VSDELETEITEMOPERATION怎么用?C# __VSDELETEITEMOPERATION使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
__VSDELETEITEMOPERATION类属于命名空间,在下文中一共展示了__VSDELETEITEMOPERATION类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanDeleteItem
/// <summary>
/// SearchPathContainer Node cannot be deleted.
/// </summary>
protected override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation)
{
return false;
}
示例2: CanDeleteItem
protected override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation)
{
if (deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_RemoveFromProject)
{
return true;
}
return false;
}
示例3: CanDeleteItem
protected override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation)
{
if(deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_DeleteFromStorage)
{
return this.ProjectMgr.CanProjectDeleteItems;
}
return false;
}
示例4: ShowDeleteMessage
protected internal override void ShowDeleteMessage(IList<HierarchyNode> nodes, __VSDELETEITEMOPERATION action, out bool cancel, out bool useStandardDialog) {
// Don't prompt if all the nodes are references
useStandardDialog = !nodes.All(n => n is ReferenceNode);
cancel = false;
}
示例5: CanDeleteItem
public override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation)
{
// this is reference to FSharp.Core that uses value of TargetFSharpCoreVersion property - prohibit deletion
if (IsSpecialFSharpCoreReference)
{
return false;
}
return base.CanDeleteItem(deleteOperation);
}
示例6: CanDeleteItem
internal override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation) {
return _canUninstall && deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_RemoveFromProject;
}
示例7: ShowDeleteMessage
protected internal override void ShowDeleteMessage(IList<HierarchyNode> nodes, __VSDELETEITEMOPERATION action, out bool cancel, out bool useStandardDialog) {
if (nodes.All(n => n is InterpretersPackageNode) &&
nodes.Cast<InterpretersPackageNode>().All(n => n.Parent == Parent)) {
string message;
if (nodes.Count == 1) {
message = Strings.UninstallPackage.FormatUI(
Caption,
Parent._factory.Description,
Parent._factory.Configuration.PrefixPath
);
} else {
message = Strings.UninstallPackages.FormatUI(
string.Join(Environment.NewLine, nodes.Select(n => n.Caption)),
Parent._factory.Description,
Parent._factory.Configuration.PrefixPath
);
}
useStandardDialog = false;
cancel = VsShellUtilities.ShowMessageBox(
ProjectMgr.Site,
string.Empty,
message,
OLEMSGICON.OLEMSGICON_WARNING,
OLEMSGBUTTON.OLEMSGBUTTON_OKCANCEL,
OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST
) != NativeMethods.IDOK;
} else {
useStandardDialog = false;
cancel = true;
}
}
示例8: CanDeleteItem
internal override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation) {
var service = _interpreterService as IInterpreterOptionsService2;
if (service != null && service.IsInterpreterLocked(_factory, InstallPackageLockMoniker)) {
// Prevent the environment from being deleted while installing.
return false;
}
if (deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_RemoveFromProject) {
// Interpreter and InterpreterReference can both be removed from
// the project, but the default environment cannot
return _canRemove;
} else if (deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_DeleteFromStorage) {
// Only Interpreter can be deleted.
return _canDelete;
}
return false;
}
示例9: CanDeleteItem
/// <summary>
/// Common Folder Node can only be deleted from file system.
/// </summary>
internal override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation) {
return deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_DeleteFromStorage;
}
示例10: CanDeleteItem
/// <summary>
/// Common File Node can only be deleted from file system.
/// </summary>
internal override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation) {
if (IsLinkFile) {
// we don't delete link items, we only remove them from the project. If we were
// to return true when queried for both delete from storage and remove from project
// the user would be prompted about which they would like to do.
return deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_RemoveFromProject;
}
return deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_DeleteFromStorage;
}
示例11: CanDeleteItem
protected override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation)
{
__VSDELETEITEMOPERATION supportedOp = !this.IsLink ?
__VSDELETEITEMOPERATION.DELITEMOP_DeleteFromStorage : __VSDELETEITEMOPERATION.DELITEMOP_RemoveFromProject;
if (deleteOperation == supportedOp)
{
return this.ProjectMgr.CanProjectDeleteItems;
}
return false;
}
示例12: CanDeleteItem
protected override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation)
{
string linkPath = this.ItemNode.GetMetadata(ProjectFileConstants.Link);
__VSDELETEITEMOPERATION supportedOp = String.IsNullOrEmpty(linkPath) ?
__VSDELETEITEMOPERATION.DELITEMOP_DeleteFromStorage : __VSDELETEITEMOPERATION.DELITEMOP_RemoveFromProject;
if (deleteOperation == supportedOp)
{
return this.ProjectManager.CanProjectDeleteItems;
}
return false;
}
示例13: PromptAndDelete
private void PromptAndDelete(HierarchyItem item, IVsHierarchyDeleteHandler deleteHandler, __VSDELETEITEMOPERATION deleteType, string message) {
Guid unused = Guid.Empty;
int result;
// show delete dialog...
if (ErrorHandler.Succeeded(
_mockVs.UIShell.ShowMessageBox(
0,
ref unused,
null,
message,
null,
0,
OLEMSGBUTTON.OLEMSGBUTTON_OKCANCEL,
OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST,
OLEMSGICON.OLEMSGICON_WARNING,
0,
out result
)) && result == DialogResult.OK) {
int hr = deleteHandler.DeleteItem(
(uint)deleteType,
item.ItemId
);
if (ErrorHandler.Failed(hr) && hr != VSConstants.OLE_E_PROMPTSAVECANCELLED) {
_mockVs.UIShell.ReportErrorInfo(hr);
}
}
}
示例14: CanDeleteItem
/// <summary>
/// This is overridden to prevent deletion of linked project items.
/// Linked items can still be removed/excluded.
/// </summary>
/// <param name="deleteOperation">The delete operation to perform</param>
/// <returns>True if the item can be deleted based on the requested
/// operation or false if it cannot.</returns>
protected override bool CanDeleteItem(__VSDELETEITEMOPERATION deleteOperation)
{
if(deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_DeleteFromStorage)
{
// !EFW - Cannot delete linked items
if(!String.IsNullOrEmpty(this.ItemNode.GetMetadata(ProjectFileConstants.Link)))
return false;
return this.ProjectMgr.CanProjectDeleteItems;
}
// Remove is allowed for linked items
if(deleteOperation == __VSDELETEITEMOPERATION.DELITEMOP_RemoveFromProject)
return !String.IsNullOrEmpty(this.ItemNode.GetMetadata(ProjectFileConstants.Link));
return false;
}