Example #1
0
        public static IFeatureWorkspace CreateTestShapefileWorkspace(
            [NotNull] string gdbName)
        {
            string dir = Path.GetTempPath();

            string folder = Path.Combine(dir, gdbName);

            if (Directory.Exists(folder))
            {
                Directory.Delete(folder, true);
            }

            IWorkspaceName wsName = WorkspaceUtils.CreateShapefileWorkspace(dir, gdbName);

            return((IFeatureWorkspace)((IName)wsName).Open());
        }
        private static IWorkspaceName GetWorkspaceName(
            IssueRepositoryType issueRepositoryType,
            [NotNull] string directoryPath,
            [NotNull] string gdbName)
        {
            switch (issueRepositoryType)
            {
            case IssueRepositoryType.None:
                return(null);

            case IssueRepositoryType.FileGdb:
                return(WorkspaceUtils.CreateFileGdbWorkspace(directoryPath, gdbName));

            case IssueRepositoryType.Shapefiles:
                return(WorkspaceUtils.CreateShapefileWorkspace(directoryPath, gdbName));

            default:
                throw new ArgumentOutOfRangeException(nameof(issueRepositoryType));
            }
        }