本文整理汇总了C#中JadeData.Persistence.Workspace.ProjectType类的典型用法代码示例。如果您正苦于以下问题:C# ProjectType类的具体用法?C# ProjectType怎么用?C# ProjectType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectType类属于JadeData.Persistence.Workspace命名空间,在下文中一共展示了ProjectType类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeProject
static private ProjectType MakeProject(JadeData.Workspace.ProjectItem proj)
{
ProjectType result = new ProjectType();
result.Path = proj.Path;
Persistence.Project.Writer.Write(proj, proj.Path);
return result;
}
示例2: Write
static public string Write(JadeData.Workspace.IWorkspace workspace, string path)
{
string workspaceDir = System.IO.Path.GetDirectoryName(path);
JadeData.Workspace.IFolder folder = workspace;
WorkspaceType result = new WorkspaceType();
result.Name = workspace.Name;
FolderType[] subs = new FolderType[folder.Folders.Count];
for (int i = 0; i < folder.Folders.Count; i++)
{
subs[i] = MakeFolder(folder.Folders[i], workspaceDir);
}
result.Folders = subs;
List<JadeData.Workspace.ProjectItem> projTemps = new List<JadeData.Workspace.ProjectItem>();
foreach (JadeData.Workspace.ProjectItem proj in folder.Items.OfType<JadeData.Workspace.ProjectItem>())
{
projTemps.Add(proj);
}
ProjectType[] projs = new ProjectType[projTemps.Count];
for (int i = 0; i < projTemps.Count; i++)
{
projs[i] = MakeProject(projTemps[i], workspaceDir);
}
result.Projects = projs;
System.Xml.XmlDocument doc = new XmlDocument();
System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(result.GetType());
System.IO.TextWriter stream = new System.IO.StreamWriter(path);
try
{
serializer.Serialize(stream, result);
stream.Close();
return "";
}
catch
{
throw;
}
finally
{
stream.Close();
stream.Dispose();
}
}
示例3: MakeFolder
static private FolderType MakeFolder(JadeData.Workspace.IFolder folder, string workspaceDir)
{
FolderType result = new FolderType();
result.Name = folder.Name;
FolderType[] subs = new FolderType[folder.Folders.Count];
for (int i = 0; i < folder.Folders.Count; i++)
{
subs[i] = MakeFolder(folder.Folders[i], workspaceDir);
}
result.Folders = subs;
List<JadeData.Workspace.ProjectItem> projTemps = new List<JadeData.Workspace.ProjectItem>();
foreach (JadeData.Workspace.ProjectItem proj in folder.Items.OfType<JadeData.Workspace.ProjectItem>())
{
projTemps.Add(proj);
}
ProjectType[] projs = new ProjectType[projTemps.Count];
for(int i=0;i<projTemps.Count;i++)
{
projs[i] = MakeProject(projTemps[i], workspaceDir);
}
result.Projects = projs;
return result;
}
示例4: MakeProject
static private ProjectType MakeProject(JadeData.Workspace.ProjectItem proj, string workspaceDir)
{
ProjectType result = new ProjectType();
string absPath = proj.Path;
if (System.IO.Path.IsPathRooted(absPath) == false)
{
absPath = System.IO.Path.Combine(workspaceDir, absPath);
}
result.Path = proj.Path;
Persistence.Project.Writer.Write(proj, absPath);
return result;
}