• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# JadeData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中JadeData的典型用法代码示例。如果您正苦于以下问题:C# JadeData类的具体用法?C# JadeData怎么用?C# JadeData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JadeData类属于命名空间,在下文中一共展示了JadeData类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:JadeHub,项目名称:Jade,代码行数:7,代码来源:ProjectReaderWriter.cs


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


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


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


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


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


示例7: Project

 public Project(Workspace workspace, TreeNodeBase parent, JadeData.Project.IProject project)
     :base(workspace, parent, project)
 {
     _data = project;
 }
开发者ID:JadeHub,项目名称:Jade,代码行数:5,代码来源:ProjectViewModel.cs


示例8: File

 public File(TreeNodeBase parent, JadeData.Project.File file)
     :   base(file.Name, parent)
 {
     _data = file;
 }
开发者ID:JadeHub,项目名称:Jade,代码行数:5,代码来源:ProjectViewModel.cs


示例9: Workspace

        public Workspace(JadeData.Workspace.IWorkspace workspace)
            : base(null, workspace)
        {
            this.Initialise(this);

            _data = workspace;
            _modified = false;
            this.Expanded = true;
        }
开发者ID:JadeHub,项目名称:Jade,代码行数:9,代码来源:WorkspaceViewModel.cs


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


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


示例12: WorkspaceFolder

 public WorkspaceFolder(TreeNodeBase parent, JadeData.Workspace.IFolder folder)
     :   base(folder.Name, parent)
 {
     _data = folder;
 }
开发者ID:JadeHub,项目名称:Jade,代码行数:5,代码来源:WorkspaceViewModel.cs


示例13: AddFolder

 public void AddFolder(JadeData.Project.IFolder f) {_project.AddFolder(f);}
开发者ID:JadeHub,项目名称:Jade,代码行数:1,代码来源:Workspace.cs


示例14: AddItem

 public void AddItem(JadeData.Project.IItem item) { _project.AddItem(item); }
开发者ID:JadeHub,项目名称:Jade,代码行数:1,代码来源:Workspace.cs


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


示例16: GetProjectPath

 static private string GetProjectPath(JadeData.Workspace.IWorkspace workspace, JadeData.Project.IProject proj)
 {
     return "";
 }
开发者ID:JadeHub,项目名称:Jade,代码行数:4,代码来源:test.cs


示例17: 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


示例18: OpenSourceFile

 public void OpenSourceFile(JadeData.Project.File file)
 {
     DocumentViewModel d = new DocumentViewModel(file.Name, "Test " + file.Name);
     _openDocuments.Add(d);
     SelectedDocument = d;
 }
开发者ID:JadeHub,项目名称:Jade,代码行数:6,代码来源:EditorControlViewModel.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Janus类代码示例发布时间:2022-05-24
下一篇:
C# ViewModels.IJadeViewModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap