本文整理汇总了C#中FileNode.GetFileName方法的典型用法代码示例。如果您正苦于以下问题:C# FileNode.GetFileName方法的具体用法?C# FileNode.GetFileName怎么用?C# FileNode.GetFileName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileNode
的用法示例。
在下文中一共展示了FileNode.GetFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Conflict
public Conflict(Collection col, Node node)
{
iFolderID = col.ID;
ConflictID = node.ID;
Simias.Sync.Conflict conflict = new Simias.Sync.Conflict(col, node);
if(conflict.IsFileNameConflict)
{
IsNameConflict = true;
FileNode fileNode = node as FileNode;
if (fileNode != null)
{
string name = Path.GetFileName(conflict.NonconflictedPath);
if (name.Equals(Path.GetFileName(conflict.FileNameConflictPath)))
{
LocalName = name;
LocalDate = fileNode.LastWriteTime.ToString();
LocalSize = formatFileSize(fileNode.Length);
LocalFullPath = conflict.FileNameConflictPath;
}
else
{
ServerName = name;
ServerDate = fileNode.LastWriteTime.ToString();
ServerSize = formatFileSize(fileNode.Length);
ServerFullPath = conflict.NonconflictedPath;
}
}
else
{
DirNode dn = node as DirNode;
if (dn != null)
{
if (dn.Name.Equals(Path.GetFileName(conflict.FileNameConflictPath)))
{
LocalName = dn.Name;
LocalDate = null;
LocalSize = null;
LocalFullPath = conflict.FileNameConflictPath;
}
else
{
ServerName = dn.Name;
ServerDate = null;
ServerSize = null;
ServerFullPath = conflict.NonconflictedPath;
}
}
}
}
else
{
IsNameConflict = false;
FileNode localFileNode = new FileNode(node);
Node serverNode = col.GetNodeFromCollision(node);
FileNode serverFileNode = new FileNode(serverNode);
LocalName = localFileNode.GetFileName();
LocalDate = localFileNode.LastWriteTime.ToString();
LocalSize = formatFileSize(localFileNode.Length);
LocalFullPath = conflict.NonconflictedPath;
ServerName = serverFileNode.GetFileName();
ServerDate = serverFileNode.LastWriteTime.ToString();
ServerSize = formatFileSize(serverFileNode.Length);
ServerFullPath = conflict.UpdateConflictPath;
}
}