本文整理匯總了C#中MonoDevelop.VersionControl.VersionInfo.HasLocalChange方法的典型用法代碼示例。如果您正苦於以下問題:C# VersionInfo.HasLocalChange方法的具體用法?C# VersionInfo.HasLocalChange怎麽用?C# VersionInfo.HasLocalChange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoDevelop.VersionControl.VersionInfo
的用法示例。
在下文中一共展示了VersionInfo.HasLocalChange方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: GetSupportedOperations
internal protected virtual VersionControlOperation GetSupportedOperations (VersionInfo vinfo)
{
VersionControlOperation operations = VersionControlOperation.None;
bool exists = !vinfo.LocalPath.IsNullOrEmpty && (File.Exists (vinfo.LocalPath) || Directory.Exists (vinfo.LocalPath));
if (vinfo.IsVersioned) {
operations = VersionControlOperation.Commit | VersionControlOperation.Update;
if (!vinfo.HasLocalChange (VersionStatus.ScheduledAdd))
operations |= VersionControlOperation.Log;
if (exists) {
if (!vinfo.HasLocalChange (VersionStatus.ScheduledDelete))
operations |= VersionControlOperation.Remove;
if (vinfo.HasLocalChanges || vinfo.IsDirectory)
operations |= VersionControlOperation.Revert;
}
if (AllowLocking && !vinfo.IsDirectory) {
if (!vinfo.HasLocalChanges && (vinfo.Status & VersionStatus.LockOwned) == 0)
operations |= VersionControlOperation.Lock;
if ((vinfo.Status & VersionStatus.LockOwned) != 0)
operations |= VersionControlOperation.Unlock;
}
}
else if (exists) {
operations = VersionControlOperation.Add;
}
return operations;
}