当前位置: 首页>>代码示例>>C#>>正文


C# Workspace.ProjectType类代码示例

本文整理汇总了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;
        }
开发者ID:JadeHub,项目名称:Jade,代码行数:8,代码来源:WorkspaceReaderWriter.cs

示例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();
            }
        }
开发者ID:JadeHub,项目名称:Jade,代码行数:47,代码来源:test.cs

示例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;
        }
开发者ID:JadeHub,项目名称:Jade,代码行数:26,代码来源:test.cs

示例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;
        }
开发者ID:JadeHub,项目名称:Jade,代码行数:15,代码来源:test.cs


注:本文中的JadeData.Persistence.Workspace.ProjectType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。