本文整理汇总了C#中IActivityIOOperationsEndPoint.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# IActivityIOOperationsEndPoint.Delete方法的具体用法?C# IActivityIOOperationsEndPoint.Delete怎么用?C# IActivityIOOperationsEndPoint.Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IActivityIOOperationsEndPoint
的用法示例。
在下文中一共展示了IActivityIOOperationsEndPoint.Delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Delete
public string Delete(IActivityIOOperationsEndPoint src)
{
var result = ResultOk;
try
{
if(!src.Delete(src.IOPath))
{
result = ResultBad;
}
}
finally
{
_filesToDelete.ForEach(RemoveTmpFile);
}
return result;
}
示例2: Move
public string Move(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst,
Dev2CRUDOperationTO args)
{
string result;
try
{
result = Copy(src, dst, args);
if(result.Equals("Success"))
{
src.Delete(src.IOPath);
}
}
finally
{
_filesToDelete.ForEach(RemoveTmpFile);
}
return result;
}
示例3: ValidateRenameSourceAndDesinationTypes
string ValidateRenameSourceAndDesinationTypes(IActivityIOOperationsEndPoint src,
IActivityIOOperationsEndPoint dst,
Dev2CRUDOperationTO args)
{
//ensures that the source and destination locations are of the same type
if(src.PathIs(src.IOPath) != dst.PathIs(dst.IOPath))
{
throw new Exception("Source and destination need to be both files or directories");
}
//Rename Tool if the file/folder exists then delete it and put the source there
if(dst.PathExist(dst.IOPath))
{
if(!args.Overwrite)
{
throw new Exception("Destination directory already exists and overwrite is set to false");
}
//Clear the existing folder
dst.Delete(dst.IOPath);
}
return Move(src, dst, args);
}