本文整理汇总了C#中FileSystem.UpdateFileInfo方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystem.UpdateFileInfo方法的具体用法?C# FileSystem.UpdateFileInfo怎么用?C# FileSystem.UpdateFileInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem
的用法示例。
在下文中一共展示了FileSystem.UpdateFileInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
/// <summary>
/// Update a rubric entry
/// </summary>
public bool Update(Rubric rub)
{
//check permission
Assignment asst = new Assignments(m_ident).GetInfo(rub.AsstID);
Authorize(asst.CourseID, "updaterubric", asst.ID, null);
//Rename zone on entry rename
if (rub.EvalID >= 0) {
FileSystem fs = new FileSystem(m_ident);
int zoneID =
(new Evaluations(m_ident).GetInfo(rub.EvalID) as AutoEvaluation).ZoneID;
CFile zdir = fs.GetFile(zoneID);
zdir.Alias = rub.Name;
fs.UpdateFileInfo(zdir, false);
}
//Update entry
m_dp.UpdateRubricEntry(rub);
//Retally points and update root entry
Rubric root = new Assignments(m_ident).GetRubric(rub.AsstID);
root.Points = RetallyPoints(root);
m_dp.UpdateRubricEntry(root);
//Log
Log("Updated rubric entry: " + rub.Name, rub.AsstID);
return true;
}
示例2: CommitTestSource
private int CommitTestSource(AutoEvaluation eval, IExternalSource zone)
{
FileSystem fs = new FileSystem(m_ident);
//Make sure toplevel zone directory exists
CFile zonedir = fs.GetFile(@"c:\zones");
if (null == zonedir)
zonedir = fs.CreateDirectory(@"c:\zones", true, null);
//Build file perms
CFilePermission.FilePermissionList perms = new CFilePermission.FilePermissionList();
CourseRole.CourseRoleList staff = new Courses(m_ident).GetTypedRoles(eval.CourseID, true, null);
foreach (CourseRole role in staff)
perms.AddRange(CFilePermission.CreateFullAccess(role.PrincipalID));
//Create zone directory
string zpath = @"c:\zones\" + eval.ID;
CFile ezonedir;
if (null == (ezonedir = fs.GetFile(zpath))) {
ezonedir = fs.CreateDirectory(zpath, false, perms);
ezonedir.Alias = eval.Name; ezonedir.SpecType = CFile.SpecialType.TEST;
fs.UpdateFileInfo(ezonedir, false);
}
fs.ImportData(zpath, zone, false, true); //Import the data
return ezonedir.ID;
}