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


C# ProjectManager.ExistsProject方法代码示例

本文整理汇总了C#中ProjectManager.ExistsProject方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectManager.ExistsProject方法的具体用法?C# ProjectManager.ExistsProject怎么用?C# ProjectManager.ExistsProject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectManager的用法示例。


在下文中一共展示了ProjectManager.ExistsProject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

      /// <summary>
      /// Creates project or get the existing project, or overwrite the existing
      /// </summary>
      /// <param name="projectLinkFilePath">EPLAN project file (*.elk)</param>
      /// <param name="projectTemplateFilePath">EPLAN template project (*.zw9)</param>
      /// <param name="overwrite">Overwrites the existing project, False: Open the project</param>
      /// <returns>EPLAN Project</returns>
      public static Project Create(string projectLinkFilePath, string projectTemplateFilePath, bool overwrite)
      {
         ProjectManager projectManager = new ProjectManager();
         Project project = null;

         using (new LockingStep()) // needed
         {
            // Exists
            if (projectManager.ExistsProject(projectLinkFilePath) && overwrite == false)
            {
               project = OpenProject(projectLinkFilePath);
            }

            // New
            if (!projectManager.ExistsProject(projectLinkFilePath) || overwrite == true)
            {

               project = projectManager.CreateProject(projectLinkFilePath, projectTemplateFilePath);
            }
         }

         return project;
      }
开发者ID:Suplanus,项目名称:Suplanus.Sepla,代码行数:30,代码来源:ProjectUtility.cs

示例2: Copy

      /// <summary>
      /// Copy the project or get the existing project, or overwrite the existing
      /// </summary>
      /// <param name="projectSource">Source project</param>
      /// <param name="projectLinkFilePath">EPLAN project file (*.elk)</param>
      /// <param name="overwrite">Overwrites the existing project, False: Open the project</param>
      /// <returns>EPLAN Project</returns>
      public static Project Copy(Project projectSource, string projectLinkFilePath, bool overwrite)
      {
         using (new LockingStep()) // needed
         {
            ProjectManager projectManager = new ProjectManager();

            // New
            if (!projectManager.ExistsProject(projectLinkFilePath) || overwrite == true)
            {
               projectManager.CopyProject(projectSource.ProjectLinkFilePath, projectLinkFilePath,
                  ProjectManager.CopyMode.OnlyProjecthead);
            }

            return OpenProject(projectLinkFilePath);
         }
      }
开发者ID:Suplanus,项目名称:Suplanus.Sepla,代码行数:23,代码来源:ProjectUtility.cs


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