本文整理汇总了C#中JadeData类的典型用法代码示例。如果您正苦于以下问题:C# JadeData类的具体用法?C# JadeData怎么用?C# JadeData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JadeData类属于命名空间,在下文中一共展示了JadeData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MakeFile
static private FileType MakeFile(JadeData.Project.File file)
{
FileType result = new FileType();
result.Name = file.Name;
result.Path = file.Path;
return result;
}
示例2: MakeFolder
static private FolderType MakeFolder(JadeData.Workspace.IFolder folder)
{
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]);
}
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]);
}
result.Projects = projs;
return result;
}
示例3: 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;
}
示例4: MakeFolder
static private FolderType MakeFolder(JadeData.Project.IFolder folder)
{
FolderType result = new FolderType();
result.Name = folder.Name;
result.Files = new FileType[folder.Items.OfType<JadeData.Project.File>().Count()];
result.Folders = new FolderType[folder.Folders.Count];
int idx = 0;
foreach (JadeData.Project.File f in folder.Items.OfType<JadeData.Project.File>())
{
result.Files[idx] = MakeFile(f);
idx++;
}
idx = 0;
foreach (JadeData.Project.IFolder f in folder.Folders)
{
result.Folders[idx] = MakeFolder(f);
}
return result;
}
示例5: 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;
}
示例6: ProjectFolder
public ProjectFolder(Workspace workspace, TreeNodeBase parent, JadeData.Project.IFolder data)
: base(data.Name, parent)
{
_workspace = workspace;
_data = data;
foreach (JadeData.Project.IFolder f in _data.Folders)
{
AddChildFolder(new ProjectFolder(workspace, this, f));
}
foreach (JadeData.Project.IItem i in _data.Items)
{
if (i is JadeData.Project.File)
{
AddChildFile(new File(this, i as JadeData.Project.File));
}
}
}
示例7: Project
public Project(Workspace workspace, TreeNodeBase parent, JadeData.Project.IProject project)
:base(workspace, parent, project)
{
_data = project;
}
示例8: File
public File(TreeNodeBase parent, JadeData.Project.File file)
: base(file.Name, parent)
{
_data = file;
}
示例9: Workspace
public Workspace(JadeData.Workspace.IWorkspace workspace)
: base(null, workspace)
{
this.Initialise(this);
_data = workspace;
_modified = false;
this.Expanded = true;
}
示例10: AddChildProject
private void AddChildProject(JadeData.Project.IProject p)
{
Project project = new Project(_workspace, this, p);
project.RemoveCommand.Attach(param => OnRemoveProject(param), param => CanDoRemoveProject(param));
Children.Add(project);
}
示例11: AddChildFolder
private void AddChildFolder(JadeData.Workspace.IFolder f)
{
WorkspaceFolder folder = new WorkspaceFolder(this, f);
folder.Initialise(_workspace);
folder.RemoveCommand.Attach(param => OnRemoveFolder(param), param => CanDoRemoveFolder(param));
Children.Add(folder);
}
示例12: WorkspaceFolder
public WorkspaceFolder(TreeNodeBase parent, JadeData.Workspace.IFolder folder)
: base(folder.Name, parent)
{
_data = folder;
}
示例13: AddFolder
public void AddFolder(JadeData.Project.IFolder f) {_project.AddFolder(f);}
示例14: AddItem
public void AddItem(JadeData.Project.IItem item) { _project.AddItem(item); }
示例15: Write
static public void Write(JadeData.Project.IProject project, string path)
{
ProjectType result = new ProjectType();
result.Name = project.Name;
result.Files = new FileType[project.Items.OfType<JadeData.Project.File>().Count()];
result.Folders = new FolderType[project.Folders.Count];
int idx = 0;
foreach (JadeData.Project.File f in project.Items.OfType<JadeData.Project.File>())
{
result.Files[idx] = MakeFile(f);
idx++;
}
idx = 0;
foreach (JadeData.Project.IFolder f in project.Folders)
{
result.Folders[idx] = MakeFolder(f);
}
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();
}
}