コード例 #1
0
ファイル: SolutionWriter.cs プロジェクト: n017/dnSpy
        public SolutionWriter(ProjectVersion projectVersion, IList<Project> projects, string filename)
        {
            this.projectVersion = projectVersion;
            this.projects = projects.ToList();
            this.projects.Sort((a, b) => {
                // Sort exes first since VS picks the first file in the solution to be the
                // "StartUp Project".
                int ae = (a.Module.Characteristics & Characteristics.Dll) == 0 ? 0 : 1;
                int be = (b.Module.Characteristics & Characteristics.Dll) == 0 ? 0 : 1;
                int c = ae.CompareTo(be);
                if (c != 0)
                    return c;
                return StringComparer.OrdinalIgnoreCase.Compare(a.Filename, b.Filename);
            });
            this.filename = filename;

            this.configs = new List<string>();
            this.configs.Add("Debug");
            this.configs.Add("Release");

            var hash = new HashSet<string>(projects.Select(a => a.Platform));
            this.platforms = new List<string>(hash.Count);
            this.platforms.Add("Any CPU");
            hash.Remove("AnyCPU");
            if (hash.Count > 0)
                this.platforms.Add("Mixed Platforms");
            foreach (var p in hash)
                this.platforms.Add(p);
        }
コード例 #2
0
ファイル: ProjectWriter.cs プロジェクト: n017/dnSpy
 public ProjectWriter(Project project, ProjectVersion projectVersion, IList<Project> allProjects, IList<string> userGACPaths)
 {
     this.project = project;
     this.projectVersion = projectVersion;
     this.allProjects = allProjects;
     this.userGACPaths = userGACPaths;
 }
コード例 #3
0
        public void AddVersion(ProjectVersion version, ProjectVersion afterVersion)
        {
            if (afterVersion != null)
            {
                version.SortOrder = afterVersion.SortOrder;
            }

            _projectRepo.IncrememtOrderingAfterVersion(version);
            _projectRepo.Save(version);
        }
コード例 #4
0
ファイル: UpdateDialog.xaml.cs プロジェクト: HADB/ListManager
        public UpdateDialog(ProjectVersion localVersion, ProjectVersion latestVersion)
        {
            InitializeComponent();
            this.localVersion = localVersion;
            this.latestVersion = latestVersion;

            lbLocalVersion.Content = localVersion.AssemblyVersion;
            lbLatestVersion.Content = latestVersion.AssemblyVersion;

            directoryPath = Info.GetDirectory();
            webClient = new WebClient();
            webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadProgressChanged);
            webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileCompleted);
        }
コード例 #5
0
ファイル: VersionMenu.cs プロジェクト: Kuzq/gitter
        public VersionMenu(ProjectVersion version)
        {
            Verify.Argument.IsNotNull(version, "version");

            _version = version;

            Items.Add(GuiItemFactory.GetUpdateRedmineObjectItem<ToolStripMenuItem>(_version));

            var item = new ToolStripMenuItem(Resources.StrCopyToClipboard);
            item.DropDownItems.Add(GuiItemFactory.GetCopyToClipboardItem<ToolStripMenuItem>(Resources.StrId, _version.Id.ToString(CultureInfo.InvariantCulture)));
            item.DropDownItems.Add(GuiItemFactory.GetCopyToClipboardItem<ToolStripMenuItem>(Resources.StrName, _version.Name));
            if(!string.IsNullOrWhiteSpace(_version.Description))
            {
                item.DropDownItems.Add(GuiItemFactory.GetCopyToClipboardItem<ToolStripMenuItem>(Resources.StrDescription, _version.Description));
            }

            Items.Add(item);
        }
コード例 #6
0
        /// <summary>
        ///   Save versions of project marked for update. New version is
        ///   generated by <c>NewVersionProvider</c>.
        /// </summary>
        public void SaveVersions()
        {
            ProjectVersion highestVersion = HighestVersion;

            foreach (ProjectInfo projectInfo in ProjectsToUpdate)
            {
                foreach (AssemblyVersionType at in projectInfo.CurrentAssemblyVersions.GetValidVersionTypes())
                {
                    if ((AssemblyVersionsUpdateMask & at) == at)
                    {
                        string newVersion = m_newVersionProvider.ProvideNewVersion(projectInfo, at, highestVersion);
                        if (newVersion != projectInfo.CurrentAssemblyVersions[at].ToString())
                        {
                            if (projectInfo.Save(at, newVersion))
                            {
                                m_updateSummary.SetUpdated(projectInfo, at, newVersion);
                            }
                        }
                    }
                }
            }
        }
コード例 #7
0
        public void Initialize(Exolutio.Controller.Controller controller, ProjectVersion projectVersion, PSMSchema psmSchema)
        {
            this.controller     = controller;
            this.projectVersion = projectVersion;

            this.cbPSMSchema.ItemsSource = projectVersion.PSMSchemas;
            if (psmSchema != null)
            {
                this.cbPSMSchema.SelectedItem = psmSchema;
            }

            IEnumerable <AttributeType> existingPIMTypes = this.projectVersion.GetAvailablePIMTypes();

            baseTypeColumnPIM.ItemsSource = existingPIMTypes;
            ObservableCollection <FakeAttributeType> fakePIMAttributeTypesList = new ObservableCollection <FakeAttributeType>();

            fakePIMAttributeTypes = new FakeAttributeTypeCollection(fakePIMAttributeTypesList, existingPIMTypes);
            fakePIMAttributeTypesList.CollectionChanged += delegate { UpdateApplyEnabled(); };
            gridPIMAttributeTypes.ItemsSource            = fakePIMAttributeTypesList;

            if (psmSchema != null)
            {
                PSMSchema = psmSchema;
                IEnumerable <AttributeType> existingPSMTypes = PSMSchema.GetAvailablePSMTypes();
                baseTypeColumnPSM.ItemsSource = existingPSMTypes;
                ObservableCollection <FakeAttributeType> fakePSMAttributeTypesList =
                    new ObservableCollection <FakeAttributeType>();
                fakePSMAttributeTypes = new FakeAttributeTypeCollection(fakePSMAttributeTypesList, existingPSMTypes);
                fakePSMAttributeTypesList.CollectionChanged += delegate { UpdateApplyEnabled(); };
                gridPSMAttributeTypes.ItemsSource            = fakePSMAttributeTypesList;
            }
            else
            {
                PSMSchema = null;
            }

            dialogReady      = true;
            bApply.IsEnabled = false;
        }
コード例 #8
0
        public void EmbedVersion(ProjectVersion embededVersion, Version newVersion, Version branchedFrom, bool keepGuids, bool createVersionLinks)
        {
            newVersion.BranchedFrom = branchedFrom;
            Versions.Add(newVersion);
            ProjectVersion newProjectVersion = new ProjectVersion(Project);

            newProjectVersion.Version = newVersion;

            ElementCopiesMap elementCopiesMap = new ElementCopiesMap(embededVersion.Project, Project);

            elementCopiesMap.KeepGuids = keepGuids;
            IEnumerable <ExolutioObject> allModelItems   = ModelIterator.GetAllModelItems(embededVersion);
            List <ExolutioObject>        exolutioObjects = allModelItems.ToList();

            elementCopiesMap.PrepareGuids(exolutioObjects);
            elementCopiesMap.PrepareGuid(embededVersion);

            Project.ProjectVersions.Add(newProjectVersion);
            embededVersion.FillCopy(newProjectVersion, newProjectVersion, elementCopiesMap);

            if (createVersionLinks)
            {
                foreach (KeyValuePair <IVersionedItem, IVersionedItem> kvp in elementCopiesMap)
                {
                    IVersionedItem fromEmbedded = kvp.Key;
                    IVersionedItem newlyCreated = kvp.Value;
                    ExolutioObject previousObject;
                    if (Project.TryTranslateObject(fromEmbedded.ID, out previousObject) && previousObject is IVersionedItem)
                    {
                        if (Project.mappingDictionary.ContainsKey(previousObject.ID) &&
                            Project.mappingDictionary.ContainsKey(newlyCreated.ID))
                        {
                            RegisterVersionLink(((IVersionedItem)previousObject).Version, newVersion, (IVersionedItem)previousObject, newlyCreated);
                        }
                    }
                }
            }
        }
コード例 #9
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="resource">resource</param>
        /// <returns>ApiResultProjectVersion</returns>
        public ApiResultProjectVersion CreateProjectVersion(ProjectVersion resource)
        {
            // verify the required parameter 'resource' is set
            if (resource == null)
            {
                throw new ApiException(400, "Missing required parameter 'resource' when calling CreateProjectVersion");
            }


            var path = "/projectVersions";

            path = path.Replace("{format}", "json");

            var    queryParams  = new Dictionary <String, String>();
            var    headerParams = new Dictionary <String, String>();
            var    formParams   = new Dictionary <String, String>();
            var    fileParams   = new Dictionary <String, FileParameter>();
            String postBody     = null;

            postBody = ApiClient.Serialize(resource);                                     // http body (model) parameter

            // authentication setting, if any
            String[] authSettings = new String[] { "FortifyToken" };

            // make the HTTP request
            IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

            if (((int)response.StatusCode) >= 400)
            {
                throw new ApiException((int)response.StatusCode, "Error calling CreateProjectVersion: " + response.Content, response.Content);
            }
            else if (((int)response.StatusCode) == 0)
            {
                throw new ApiException((int)response.StatusCode, "Error calling CreateProjectVersion: " + response.ErrorMessage, response.ErrorMessage);
            }

            return((ApiResultProjectVersion)ApiClient.Deserialize(response.Content, typeof(ApiResultProjectVersion), response.Headers));
        }
コード例 #10
0
        public void GetProjectVersionIssuesTest()
        {
            Jira environment = new Jira();

            environment.Connect(new MockJiraClient());

            Project project = environment.GetProject("ITDEV");

            Assert.NotNull(project);
            Assert.Equal(project.Key, "ITDEV");

            ProjectVersion firstProjectVersion = project.ProjectVersions.FirstOrDefault();

            Assert.NotNull(firstProjectVersion);
            Assert.NotNull(firstProjectVersion.Issues);
            Assert.Equal(2, firstProjectVersion.Issues.Count);

            ProjectVersion lastProjectVersion = project.ProjectVersions.LastOrDefault();

            Assert.NotNull(lastProjectVersion);
            Assert.NotNull(lastProjectVersion.Issues);
            Assert.Equal(5, lastProjectVersion.Issues.Count);
        }
コード例 #11
0
        public void Build(List <ProjectVersion> projectVersions)
        {
            ProjectVersion activeProjectVersion = null;

            try
            {
                foreach (ProjectVersion projectVersion in projectVersions.Distinct())
                {
                    activeProjectVersion = projectVersion;

                    projectVersion.SetStringProperty("LastBuildResult", "Not started");
                    entities.SaveChanges();

                    BuildJob job = new BuildJob();
                    job.Start(
                        projectVersion.Id,
                        projectId => TaskRunnerContext.SetProjectVersionState(projectId, ProjectState.Building),
                        (projectId, isSuccess) =>
                    {
                        TaskRunnerContext.SetProjectVersionState(projectId, isSuccess ? ProjectState.Idle : ProjectState.Error);
                    });
                }
            }
            catch (Exception e)
            {
                AspNetDeployException aspNetDeployException = new AspNetDeployException("Build project failed", e);
                aspNetDeployException.Data.Add("SourceControl version Id", activeProjectVersion.SourceControlVersion.Id);
                aspNetDeployException.Data.Add("Solution file", activeProjectVersion.SolutionFile);

                Factory.GetInstance <ILoggingService>().Log(aspNetDeployException, null);

                if (e.IsCritical())
                {
                    throw;
                }
            }
        }
コード例 #12
0
ファイル: SolutionWriter.cs プロジェクト: zz110/dnSpy
        public SolutionWriter(ProjectVersion projectVersion, IList <Project> projects, string filename)
        {
            this.projectVersion = projectVersion;
            this.projects       = projects.ToList();
            this.projects.Sort((a, b) => {
                // Sort exes first since VS picks the first file in the solution to be the
                // "StartUp Project".
                int ae = (a.Module.Characteristics & Characteristics.Dll) == 0 ? 0 : 1;
                int be = (b.Module.Characteristics & Characteristics.Dll) == 0 ? 0 : 1;
                int c  = ae.CompareTo(be);
                if (c != 0)
                {
                    return(c);
                }
                return(StringComparer.OrdinalIgnoreCase.Compare(a.Filename, b.Filename));
            });
            this.filename = filename;

            configs = new List <string>();
            configs.Add("Debug");
            configs.Add("Release");

            var hash = new HashSet <string>(projects.Select(a => a.Platform));

            platforms = new List <string>(hash.Count);
            platforms.Add("Any CPU");
            hash.Remove("AnyCPU");
            if (hash.Count > 0)
            {
                platforms.Add("Mixed Platforms");
            }
            foreach (var p in hash)
            {
                platforms.Add(p);
            }
        }
コード例 #13
0
ファイル: DiagramTabManager.cs プロジェクト: mff-uk/exolutio
        public void OpenTabsForProjectVersion(ProjectVersion projectVersion)
        {
            foreach (PIMDiagram pimDiagram in projectVersion.PIMDiagrams)
            {
                if (FindTab(pimDiagram) == null)
                {
                    AddTab(pimDiagram);
                }
            }

            foreach (PSMDiagram psmDiagram in projectVersion.PSMDiagrams)
            {
                if (psmDiagram.Caption == "XRX PSM")
                {
                    continue;
                }
                if (FindTab(psmDiagram) == null)
                {
                    AddTab(psmDiagram);
                }
            }

            ActivateDiagram(projectVersion.PIMDiagrams.FirstOrDefault());
        }
コード例 #14
0
        public BuildSolutionResult Build(string sourcesFolder, ProjectVersion projectVersion, Action <string> projectBuildStarted, Action <string, bool, string> projectBuildComplete, Action <string, Exception> errorLogger)
        {
            var fullPath = Path.Combine(sourcesFolder, projectVersion.ProjectFile);

            projectBuildStarted(fullPath);
            string output;

            if (DoDotnet(Path.GetDirectoryName(fullPath), "restore", out output) != 0)
            {
                errorLogger(fullPath, new DotnetCoreBuildServiceException(output));
                projectBuildComplete(fullPath, false, output);

                return(new BuildSolutionResult()
                {
                    IsSuccess = false
                });
            }

            if (DoDotnet(Path.GetDirectoryName(fullPath), "publish -c Release", out output) != 0)
            {
                errorLogger(fullPath, new DotnetCoreBuildServiceException(output));
                projectBuildComplete(fullPath, false, output);

                return(new BuildSolutionResult()
                {
                    IsSuccess = false
                });
            }

            projectBuildComplete(fullPath, true, null);

            return(new BuildSolutionResult()
            {
                IsSuccess = true
            });
        }
コード例 #15
0
        public void CreateProjectVersionFromString()
        {
            string nullString = null;

            Assert.Throws <ArgumentNullException>(() => new ProjectVersion(nullString));

            Assert.Throws <ArgumentException>(() => new ProjectVersion("1.1.1.1.1.1.1.1.1"));
            Assert.Throws <ArgumentException>(() => new ProjectVersion("1"));

            var version1 = new ProjectVersion("1.0");
            var version2 = new ProjectVersion("1.1.0");
            var version3 = new ProjectVersion("1.1.1.0");

            Assert.NotNull(version1);
            Assert.NotNull(version2);
            Assert.NotNull(version3);

            Assert.IsTrue(version2 == new ProjectVersion(1, 1, 0));

            Assert.Throws <ArgumentOutOfRangeException>(() => new ProjectVersion("-1.0.0.0"));
            Assert.Throws <ArgumentOutOfRangeException>(() => new ProjectVersion("1.-1.1.1"));
            Assert.Throws <ArgumentOutOfRangeException>(() => new ProjectVersion("1.1.-1.1"));
            Assert.Throws <ArgumentOutOfRangeException>(() => new ProjectVersion("1.1.1.-1"));
        }
コード例 #16
0
 public BuildSolutionResult Build(string sourcesFolder, ProjectVersion projectVersion, Action <string> projectBuildStarted, Action <string, bool, string> projectBuildComplete, Action <string, Exception> errorLogger)
 {
     this.nugetPackageManager.RestoreSolutionPackages(Path.Combine(sourcesFolder, projectVersion.SolutionFile));
     return(this.BuildInternal(Path.Combine(sourcesFolder, projectVersion.ProjectFile), projectBuildStarted, projectBuildComplete, errorLogger));
 }
コード例 #17
0
        private ProjectVersion CreateVersionToAdd()
        {
            const string VersionName = "VersionName";
            const string VersionDescription = "VersionDescription";

            ProjectVersion version = new ProjectVersion();
            version.ProjectId = this.FirstProjectId;
            version.Name = VersionName;
            version.Description = VersionDescription;
            version.DateOrder = DateTime.Now;
            version.IsReleased = false;

            return version;
        }
コード例 #18
0
        /// <summary>
        ///   Determines if one of <c>AssemblyVersionType</c> assembly infos
        ///   should be updated.
        /// </summary>
        /// <param name="projectInfo">
        ///   <c>ProjectInfo</c> for the project that is considered.
        /// </param>
        /// <param name="assemblyVersionType">
        ///   <c>AssemblyVersionType</c> for which version update is determined.
        /// </param>
        /// <param name="highestProjectVersion">
        ///   Highest <c>ProjectVersion</c> used as a reference for update.
        /// </param>
        /// <returns>
        ///   <c>true</c> if version should be incremented.
        /// </returns>
        private bool ShouldUpdateOneOfAssemblyVersionTypes(ProjectInfo projectInfo, AssemblyVersionType assemblyVersionType, ProjectVersion highestProjectVersion)
        {
            Debug.Assert(assemblyVersionType == AssemblyVersionType.AssemblyVersion || assemblyVersionType == AssemblyVersionType.AssemblyFileVersion || assemblyVersionType == AssemblyVersionType.AssemblyInformationalVersion);
            // first check if corresponding assembly version type exists at all
            if (projectInfo.CurrentAssemblyVersions[assemblyVersionType] == ProjectVersion.Empty)
            {
                return(false);
            }
            // else, depending on settings
            switch (m_numberingOptions.BatchCommandIncrementScheme)
            {
            case (BatchCommandIncrementScheme.IncrementModifiedIndependently):
                return(projectInfo.IsMarkedForUpdate(assemblyVersionType));

            case (BatchCommandIncrementScheme.IncrementAllIndependently):
                return(true);

            case (BatchCommandIncrementScheme.IncrementModifiedOnlyAndSynchronize):
                int resetBuildAndRevisionValues = (int)m_numberingOptions.ResetBuildAndRevisionTo;
                return(projectInfo.Modified || ProjectVersion.ApplyVersionPattern(highestProjectVersion.ToString(), projectInfo.CurrentAssemblyVersions[assemblyVersionType].ToString(), resetBuildAndRevisionValues) != projectInfo.CurrentAssemblyVersions[assemblyVersionType].ToString());//projectInfo.CurrentAssemblyVersions[assemblyVersionType] < highestProjectVersion;

            case (BatchCommandIncrementScheme.IncrementAllAndSynchronize):
                int buildAndRevisionResetValue = (int)m_numberingOptions.ResetBuildAndRevisionTo;
                return(ProjectVersion.ApplyVersionPattern(highestProjectVersion.ToString(), projectInfo.CurrentAssemblyVersions[assemblyVersionType].ToString(), buildAndRevisionResetValue) != projectInfo.CurrentAssemblyVersions[assemblyVersionType].ToString()); // projectInfo.CurrentAssemblyVersions[assemblyVersionType] < highestProjectVersion;
            }
            Debug.Assert(false, "Not supported option");
            return(false);
        }
コード例 #19
0
 public void MergeVersions(ProjectVersion fromVersion, ProjectVersion toVersion)
 {
     throw new NotImplementedException();
 }
コード例 #20
0
 public override void FillCopy(Versioning.IExolutioCloneable copyComponent, ProjectVersion projectVersion, Versioning.ElementCopiesMap createdCopies)
 {
     base.FillCopy(copyComponent, projectVersion, createdCopies);
     PSMSchemaClassViewHelper copyPSMSchemaClassViewHelper = (PSMSchemaClassViewHelper)copyComponent;
 }
コード例 #21
0
 public void ReleaseVersion(ProjectVersion version)
 {
     version.IsReleased = true;
     _projectRepo.Save(version);
 }
コード例 #22
0
 public abstract void UpdateProjectVersion(ProjectVersion projectVersion, Guid guid);
コード例 #23
0
 private void checkThatAllTemplatesAreCreatedAtLeastWithVersion(IEnumerable <PKSimBuildingBlock> buildingBlocks, ProjectVersion minVersion)
 {
     foreach (var buildingBlock in buildingBlocks)
     {
         var internalVersion = buildingBlock.Creation.InternalVersion;
         internalVersion.HasValue.ShouldBeTrue();
         internalVersion?.ShouldBeGreaterThanOrEqualTo(minVersion.Version);
     }
 }
コード例 #24
0
        static void Main(string[] args)
        {
            XDocument webConfig = XDocument.Load(@"H:\Documentoved\FiasOnline\FiasOnline.UI.API\bin\Release\netcoreapp2.0\publish\web.config");

            if (webConfig.Descendants("aspNetCore").Any(dd => dd.Attribute("processPath")?.Value == "dotnet"))
            {
            }

            using (ServerManager serverManager = new ServerManager())
            {
                //this.backupSiteConfigurationGuid = this.BackupRepository.StoreObject(site);

                ApplicationPool applicationPool  = ApplicationPool(serverManager, "AspNetDeploy");
                ApplicationPool applicationPool2 = ApplicationPool(serverManager, "ButtonBackend1");
            }



            VisualStudio2013SolutionParser      solutionParser = new VisualStudio2013SolutionParser();
            IList <VisualStudioSolutionProject> projects       = solutionParser.Parse(@"H:\Documentoved\FiasOnline\FiasOnline.sln");

            foreach (VisualStudioSolutionProject project in projects)
            {
                Console.WriteLine(project.Name + " - " + project.Type + " - " + project.Guid + " - " + project.TypeGuid);
            }

            DotnetCoreBuildService buildService = new DotnetCoreBuildService();

            ProjectVersion pv = new ProjectVersion()
            {
                Name         = "Blah",
                ProjectType  = ProjectType.Web | ProjectType.NetCore,
                ProjectFile  = @"FiasOnline.UI.API\FiasOnline.UI.API.csproj",
                SolutionFile = @"H:\Documentoved\FiasOnline"
            };

            buildService.Build(@"H:\Documentoved\FiasOnline", pv, s =>
            {
            }, (s, b, arg3) =>
            {
            }, (s, exception) =>
            {
            });

            if (File.Exists(@"H:\Documentoved\FiasOnline\blah.zip"))
            {
                File.Delete(@"H:\Documentoved\FiasOnline\blah.zip");
            }

            DotNetCoreProjectPackager projectPackager = new DotNetCoreProjectPackager();

            projectPackager.Package(@"H:\Documentoved\FiasOnline\FiasOnline.UI.API\FiasOnline.UI.API.csproj", @"H:\Documentoved\FiasOnline\blah.zip");

            Console.WriteLine(projects.Count);



            //ThreadTaskRunner.ProcessTasks();

            /*
             * VariableProcessorFactory variableProcessorFactory = new VariableProcessorFactory();
             * ProjectTestRunnerFactory projectTestRunnerFactory = new ProjectTestRunnerFactory(new PathServices());
             *
             * IVariableProcessor variableProcessor = variableProcessorFactory.Create(278, 9);
             *
             * AspNetDeployEntities entities = new AspNetDeployEntities();
             * ProjectVersion projectVersion2 = entities.ProjectVersion.Include("SourceControlVersion").First( v => v.Id == 14746);
             *
             *
             * IProjectTestRunner projectTestRunner = projectTestRunnerFactory.Create(projectVersion2.ProjectType, variableProcessor);
             *
             * IList<TestResult> testResults = projectTestRunner.Run(projectVersion2);
             *
             */

            VsTestParser            parser      = new VsTestParser();
            IList <VsTestClassInfo> testClasses = parser.Parse(@"H:\Documentoved\DocumentovedUITests\AccountTests\bin\Debug\AccountTests.dll");

            IList <TestResult> result = new List <TestResult>();

            IDictionary <string, string> d = new ConcurrentDictionary <string, string>();

            string c = null;

            Thread t = new Thread(() =>
            {
                while (true)
                {
                    Console.Clear();
                    Console.WriteLine(c);
                    foreach (string dKey in d.Keys)
                    {
                        Console.WriteLine(" - " + dKey + " - " + d[dKey]);
                    }

                    Thread.Sleep(1000);
                }
            });

            t.Start();

            foreach (VsTestClassInfo testClass in testClasses)
            {
                c = testClass.Type.FullName;
                d.Clear();

                Parallel.ForEach(testClass.TestMethods, new ParallelOptions
                {
                    MaxDegreeOfParallelism = 5
                }, testMethod =>
                {
                    d.Add(testMethod, "started");

                    VsTestRunner runner             = new VsTestRunner();
                    VsTestRunResult vsTestRunResult = runner.Run(testClass.Type, testClass.InitializeMethod, testMethod, testClass.CleanupMethod);

                    result.Add(new TestResult()
                    {
                        TestClassName = testClass.Type.FullName,
                        TestName      = testMethod,
                        IsPass        = vsTestRunResult.IsSuccess,
                        Message       = vsTestRunResult.Exception?.Message + ". " + vsTestRunResult.Exception?.InnerException?.Message
                    });

                    d[testMethod] = vsTestRunResult.IsSuccess ? "done" : "fail";
                });
            }



            Console.WriteLine("DONE");
            Console.ReadKey();


            /*
             * GulpParser gulpParser = new GulpParser(@"H:\Documentoved\Resources");
             *
             * gulpParser.LoadProjects();
             *
             * GulpProjectPackager gulpProjectPackager = new GulpProjectPackager();
             *
             * gulpProjectPackager.Package(@"H:\Documentoved\Resources\documentoved.gulpfile.js", @"H:\Documentoved\Resources\result.zip");
             *
             *
             * return;
             */
            /*
             * dynamic bindingConfig = JsonConvert.DeserializeObject("{ port:80, host:'abc.local'}");
             *
             * using (ServerManager serverManager = new ServerManager())
             * {
             *  Site site = serverManager.Sites["Account Service Latest"];
             *
             *  foreach (Binding siteBinding in site.Bindings)
             *  {
             *      siteBinding.BindingInformation = (string.IsNullOrWhiteSpace((string)bindingConfig.IP) ? "" : (string)bindingConfig.IP) + ":" + (int)bindingConfig.port + ":" + (string)bindingConfig.host;
             *  }
             *
             *  serverManager.CommitChanges();
             * }
             *
             * return;
             */


            /*
             *
             *          Machine machine = entities.Machine.First( m => m.Name == "Lake");
             *
             *          WCFSatelliteDeploymentAgent agent = new WCFSatelliteDeploymentAgent(null, machine.URL, machine.Login, machine.Password, new TimeSpan(0, 0, 0, 1), new TimeSpan(0, 0, 0, 1));
             *
             *          Console.WriteLine("Runnning");
             *          Console.WriteLine(agent.IsReady());
             */

            /*
             *
             *           List<Machine> machines = entities.Machine.ToList();
             *
             *           machines.Where( m => !m.Name.Contains("FastVPS") && !m.Name.Contains("Snow")).ToList().AsParallel().ForAll(machine =>
             *           {
             *               WCFSatelliteDeploymentAgent deploymentAgent = new WCFSatelliteDeploymentAgent(null, machine.URL, machine.Login, machine.Password, new TimeSpan(0, 0, 1));
             *               Console.WriteLine(machine.Id + " - " + machine.Name + " - " + deploymentAgent.IsReady());
             *           });
             *
             *          Console.WriteLine("-=====================-");
             *
             *          ISatelliteMonitor satelliteMonitor = new SatelliteMonitor();
             *
             *          List<Environment> environments = entities.Environment
             *              .Include("Properties")
             *              .Include("Machines.MachineRoles")
             *              .ToList();
             *
             *          Dictionary<Machine, SatelliteState> dictionary = environments.SelectMany(e => e.Machines)
             *              .Distinct()
             *              .AsParallel()
             *              .Select(m => new { m, alive = satelliteMonitor.IsAlive(m) })
             *              .ToDictionary(k => k.m, k => k.alive);
             *
             *          DateTime start = DateTime.Now;
             *
             *          Dictionary<Machine, IServerSummary> summaries = environments.SelectMany(e => e.Machines)
             *              .Distinct()
             *              .AsParallel()
             *              .Select(m => new { m, summary = satelliteMonitor.GetServerSummary(m) })
             *              .ToDictionary(k => k.m, k => k.summary);
             *
             *          DateTime end = DateTime.Now;
             *
             *          Console.WriteLine((end-start).TotalSeconds);
             *
             *          foreach (KeyValuePair<Machine, SatelliteState> serverSummary in dictionary)
             *          {
             *              Console.WriteLine(serverSummary.Key + " - " + serverSummary.Value);
             *          }
             */


            MSBuildBuildService buildBuildService = new MSBuildBuildService(new PathServices());

            DateTime?startDate = null;

            ProjectVersion projectVersion = new ProjectVersion()
            {
                // ProjectFile = @"ZelbikeRace2Database\ZelbikeRace2Database.sqlproj",
                ProjectFile  = @"Services.Accounts\Services.Accounts.csproj",
                SolutionFile = @"Documentoved.sln"
            };

            Console.WriteLine("Starting");

            BuildSolutionResult buildSolutionResult = buildBuildService.Build(@"C:\AspNetDeployWorkingFolderO\Sources\5\207", projectVersion,
                                                                              s =>
            {
                if (startDate == null)
                {
                    startDate = DateTime.Now;
                }

                Console.WriteLine(s + " - started");
            },
                                                                              (s, b, arg3) =>
            {
                Console.WriteLine(s + " - " + b);
            },
                                                                              (s, s1) =>
            {
                // e.ProjectFile, e.File, e.Code, e.LineNumber, e.ColumnNumber, e.Message
                Console.WriteLine(s + "\n" + s1);
                Console.WriteLine(s1.Message + "\n" + s1);
            });

            DateTime endDate = DateTime.Now;

            Console.WriteLine(buildSolutionResult.IsSuccess);
            Console.WriteLine((endDate - startDate.Value).TotalMilliseconds);



            /*
             * //string path = @"H:\Documentoved\Latest\Services.ImsPrimary\Databases.ImsPrimary.sqlproj";
             * string path = @"H:\Documentoved\Latest\Services.ExceptionHandlingService\Services.Logging.csproj";
             *
             * //  SolutionFile solutionFile = SolutionFile.Parse(path);
             *
             * // ProjectRootElement element = ProjectRootElement.Open(@"H:\Documentoved\Latest\Services.ExceptionHandlingService\Services.Logging.csproj");
             *
             *
             * Dictionary<string, string> globalProperty = new Dictionary<string, string>
             * {
             *  {"Configuration", "Release"}
             * };
             *
             * ProjectCollection projectCollection = new ProjectCollection();
             *
             * BuildRequestData buildRequestData = new BuildRequestData(path, globalProperty, "14.0", new[] { "Rebuild" }, null);
             *
             * BuildParameters buildParameters = new BuildParameters(projectCollection);
             * buildParameters.MaxNodeCount = 1;
             * buildParameters.Loggers = new List<ILogger>
             * {
             *  new ConsoleLogger()
             * };
             *
             *
             *
             *
             * BuildResult buildResult = Microsoft.Build.Execution.BuildManager.DefaultBuildManager.Build(buildParameters, buildRequestData);
             *
             */

            //Console.WriteLine("building " + buildResult.OverallResult);

            /*
             *
             *          ObjectFactoryConfigurator.Configure();
             *
             *          Console.WriteLine("Testing satellites");
             *
             *          AspNetDeployEntities entities = new AspNetDeployEntities();
             *
             *          MSBuildBuildService service = new MSBuildBuildService(new NugetPackageManager(new PathServices()));
             *          service.Build(
             *              @"H:\AspNetDeployWorkingFolder\Sources\5\45\CodeBase.Documents.WebUI\CodeBase.Documents.WebUI.csproj",
             *              s => Console.WriteLine("started: " + s), (s, b, arg3) => Console.WriteLine("done: " + arg3), (s, s1, arg3, arg4, arg5, arg6) => Console.WriteLine("Err: " + s));*/

            /*foreach (Machine machine in entities.Machine)
             * {
             *  Console.Write(machine.Name + "...");
             *  Console.WriteLine(Factory.GetInstance<ISatelliteMonitor>().IsAlive(machine));
             * }
             *
             * Console.ReadKey();
             *
             * RunScheduler();*/

            WriteLine("Main thread complete");
            Console.ReadKey();
        }
コード例 #25
0
        public ActionResult List()
        {
            IList <Bundle> bundles = this.bundleRepository.List();

            List <Environment> environments = this.Entities.Environment
                                              .Include("NextEnvironment")
                                              .ToList();

            int[] array = bundles.SelectMany(b => b.BundleVersions).Select(bv => bv.Id).Distinct().ToArray();

            IDictionary <int, List <int> > bundleVersionProjects = this.projectRepository.ListBundleVersionProjects(array);

            IList <ProjectVersion> projectVersions = projectRepository.ListForBundles(array);
            IList <Publication>    publications    = this.publicationRepository.ListForBundles(array);

            IDictionary <SourceControlVersion, SourceControl> sourceControls = new Dictionary <SourceControlVersion, SourceControl>();

            foreach (SourceControl sourceControl in this.sourceRepository.List(excludeArchived: false))
            {
                foreach (SourceControlVersion sourceControlVersion in sourceControl.SourceControlVersions)
                {
                    sourceControls.Add(sourceControlVersion, sourceControl);
                }
            }

            this.ViewBag.Bundles = bundles.Select(b => new BundleInfo
            {
                Bundle             = b,
                BundleVersionsInfo = b.BundleVersions
                                     .Where(bv => !bv.IsDeleted)
                                     .OrderByDescending(bv => bv.Id)
                                     .Take(2)
                                     .Select(bv =>
                {
                    BundleVersionInfo bundleVersionInfo = new BundleVersionInfo()
                    {
                        BundleVersion        = bv,
                        State                = this.taskRunner.GetBundleState(b.Id),
                        ProjectsVersionsInfo = bundleVersionProjects.ContainsKey(bv.Id)
                                ? bundleVersionProjects[bv.Id]
                                               .Select(pvId =>
                        {
                            ProjectVersion projectVersion = projectVersions.FirstOrDefault(pv => pv.Id == pvId);
                            SourceControlVersion version  = sourceControls.Keys.FirstOrDefault(scv => scv.Id == projectVersion.SourceControlVersionId);

                            return(new ProjectVersionInfo
                            {
                                ProjectVersion = projectVersion,
                                SourceControlVersion = version,
                                SourceControl = sourceControls[version]
                            });
                        })
                                               .ToList()
                                : new List <ProjectVersionInfo>(),
                        Publications = publications.Where(p => p.Package.BundleVersionId == bv.Id).GroupBy(p => p.Environment.Id).ToDictionary(k => k.Key, v => v.ToList())
                    };

                    bundleVersionInfo.Environments = new List <Environment>();
                    int homeEnvironmentId          = bv.GetIntProperty("HomeEnvironment");

                    if (homeEnvironmentId > 0)
                    {
                        bundleVersionInfo.Environments = environments.First(e => e.Id == homeEnvironmentId).GetNextEnvironments();
                    }

                    return(bundleVersionInfo);
                }).ToList()
            }).ToList();

            return(this.View());
        }
コード例 #26
0
 public IList<Ticket> GetFixedTicketsByVersion(ProjectVersion version)
 {
     return Session.CreateQuery("from Ticket t left join fetch t.FixedOnVersions v where v.Id = ?")
         .SetInt32(0, version.Id)
         .List<Ticket>();
 }
コード例 #27
0
 public void UnreleaseVersion(ProjectVersion version)
 {
     version.IsReleased = false;
     _projectRepo.Save(version);
 }
コード例 #28
0
 public void DeleteVersion(ProjectVersion version)
 {
     _projectRepo.RemoveVersionFromTickets(version);
     _projectRepo.Delete(version);
 }
コード例 #29
0
ファイル: VersionsView.cs プロジェクト: oqewok/gitter
        private void ShowVersionDetails(ProjectVersion version)
        {
            var url = ServiceContext.ServiceUri + "versions/" + version.Id;

            RedmineServiceProvider.Environment.ViewDockService.ShowWebBrowserView(url);
        }
コード例 #30
0
 public PackagesWriter(ProjectVersion projectVersion)
 {
     _projectVersion = projectVersion;
 }
コード例 #31
0
        void ParseCommandLine(string[] args)
        {
            if (args.Length == 0)
            {
                throw new ErrorException(dnSpy_Console_Resources.MissingOptions);
            }

            bool      canParseCommands = true;
            ILanguage lang             = null;
            Dictionary <string, Tuple <IDecompilerOption, Action <string> > > langDict = null;

            for (int i = 0; i < args.Length; i++)
            {
                if (lang == null)
                {
                    lang     = GetLanguage();
                    langDict = CreateLanguageOptionsDictionary(lang);
                }
                var arg  = args[i];
                var next = i + 1 < args.Length ? args[i + 1] : null;
                if (arg.Length == 0)
                {
                    continue;
                }

                // **********************************************************************
                // If you add more '--' options here, also update 'string[] ourOptions'
                // **********************************************************************

                if (canParseCommands && arg[0] == '-')
                {
                    string error;
                    switch (arg.Remove(0, 1))
                    {
                    case "":
                        canParseCommands = false;
                        break;

                    case "r":
                    case "-recursive":
                        isRecursive = true;
                        break;

                    case "o":
                    case "-output-dir":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingOutputDir);
                        }
                        outputDir = next;
                        i++;
                        break;

                    case "l":
                    case "-lang":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingLanguageName);
                        }
                        language = next;
                        i++;
                        if (GetLanguage() == null)
                        {
                            throw new ErrorException(string.Format(dnSpy_Console_Resources.LanguageDoesNotExist, language));
                        }
                        lang     = null;
                        langDict = null;
                        break;

                    case "-asm-path":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingAsmSearchPath);
                        }
                        asmPaths.AddRange(next.Split(new char[] { PATHS_SEP }, StringSplitOptions.RemoveEmptyEntries));
                        i++;
                        break;

                    case "-user-gac":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingUserGacPath);
                        }
                        userGacPaths.AddRange(next.Split(new char[] { PATHS_SEP }, StringSplitOptions.RemoveEmptyEntries));
                        i++;
                        break;

                    case "-no-gac":
                        useGac = false;
                        break;

                    case "-no-stdlib":
                        addCorlibRef = false;
                        break;

                    case "-no-sln":
                        createSlnFile = false;
                        break;

                    case "-sln-name":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingSolutionName);
                        }
                        slnName = next;
                        i++;
                        if (Path.IsPathRooted(slnName))
                        {
                            throw new ErrorException(string.Format(dnSpy_Console_Resources.InvalidSolutionName, slnName));
                        }
                        break;

                    case "-threads":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingNumberOfThreads);
                        }
                        i++;
                        numThreads = NumberVMUtils.ParseInt32(next, int.MinValue, int.MaxValue, out error);
                        if (!string.IsNullOrEmpty(error))
                        {
                            throw new ErrorException(error);
                        }
                        break;

                    case "-vs":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingVSVersion);
                        }
                        i++;
                        int vsVer;
                        vsVer = NumberVMUtils.ParseInt32(next, int.MinValue, int.MaxValue, out error);
                        if (!string.IsNullOrEmpty(error))
                        {
                            throw new ErrorException(error);
                        }
                        switch (vsVer)
                        {
                        case 2005: projectVersion = ProjectVersion.VS2005; break;

                        case 2008: projectVersion = ProjectVersion.VS2008; break;

                        case 2010: projectVersion = ProjectVersion.VS2010; break;

                        case 2012: projectVersion = ProjectVersion.VS2012; break;

                        case 2013: projectVersion = ProjectVersion.VS2013; break;

                        case 2015: projectVersion = ProjectVersion.VS2015; break;

                        default: throw new ErrorException(string.Format(dnSpy_Console_Resources.InvalidVSVersion, vsVer));
                        }
                        break;

                    case "-no-resources":
                        unpackResources = false;
                        break;

                    case "-no-resx":
                        createResX = false;
                        break;

                    case "-no-baml":
                        decompileBaml = false;
                        break;

                    case "t":
                    case "-type":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingTypeName);
                        }
                        i++;
                        typeName = next;
                        break;

                    case "-md":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingMDToken);
                        }
                        i++;
                        mdToken = NumberVMUtils.ParseInt32(next, int.MinValue, int.MaxValue, out error);
                        if (!string.IsNullOrEmpty(error))
                        {
                            throw new ErrorException(error);
                        }
                        break;

                    case "-gac-file":
                        if (next == null)
                        {
                            throw new ErrorException(dnSpy_Console_Resources.MissingGacFile);
                        }
                        i++;
                        gacFiles.Add(next);
                        break;

                    case "-project-guid":
                        if (next == null || !Guid.TryParse(next, out projectGuid))
                        {
                            throw new ErrorException(dnSpy_Console_Resources.InvalidGuid);
                        }
                        i++;
                        break;

                    default:
                        Tuple <IDecompilerOption, Action <string> > tuple;
                        if (langDict.TryGetValue(arg, out tuple))
                        {
                            bool hasArg = tuple.Item1.Type != typeof(bool);
                            if (hasArg && next == null)
                            {
                                throw new ErrorException(dnSpy_Console_Resources.MissingOptionArgument);
                            }
                            if (hasArg)
                            {
                                i++;
                            }
                            tuple.Item2(next);
                            break;
                        }

                        throw new ErrorException(string.Format(dnSpy_Console_Resources.InvalidOption, arg));
                    }
                }
                else
                {
                    files.Add(arg);
                }
            }
        }
コード例 #32
0
ファイル: MainPage.xaml.cs プロジェクト: mff-uk/exolutio
 private void UnBindProjectVersion(ProjectVersion unloadedProjectVersion)
 {
     DiagramTabManager.UnBindFromProjectVersion(unloadedProjectVersion);
     //navigatorTab.PIMModelTreeView.UnBindFromProjectVersion(unloadedProjectVersion);
     RefreshMenu();
 }
コード例 #33
0
        public void VersionEqualsWrongObject()
        {
            var version1 = new ProjectVersion(1, 1, 1, 1);

            Assert.IsTrue(!version1.Equals("test"));
        }
コード例 #34
0
 /// <summary>
 ///   Determines if an <c>AssemblyVersion</c> for the project should be
 ///   updated according to configured settings, <c>AssemblyVersionType</c>
 ///   and highest <c>ProjectVersion</c>provided.
 /// </summary>
 /// <param name="projectInfo">
 ///   <c>ProjectInfo</c> for the project that is considered.
 /// </param>
 /// <param name="assemblyVersionType">
 ///   <c>AssemblyVersionType</c> for which version update is determined.
 /// </param>
 /// <param name="highestProjectVersion">
 ///   Highest <c>ProjectVersion</c> used as a reference for update.
 /// </param>
 /// <returns>
 ///   <c>true</c> if version should be incremented.
 /// </returns>
 public bool ShouldUpdate(ProjectInfo projectInfo, AssemblyVersionType assemblyVersionType, ProjectVersion highestProjectVersion)
 {
     if (m_numberingOptions.SynchronizeAllVersionTypes)
     {
         if (!projectInfo.CurrentAssemblyVersions.AreVersionsSynchronized)
         {
             return(true);
         }
     }
     foreach (AssemblyVersionType at in AssemblyVersions.AssemblyVersionTypes)
     {
         if ((assemblyVersionType & at) == at)
         {
             if (ShouldUpdateOneOfAssemblyVersionTypes(projectInfo, at, highestProjectVersion))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
コード例 #35
0
        private void ChangeProjectDetails()
        {
            if (IsLoading)
            {
                return;
            }
            FileBasedProject currentSelectedProject = null;

            var selectedItem = (ComboboxItem)comboBox_projects.SelectedItem;
            var projectInfo  = (ProjectInfo)selectedItem.Value;

            var projects = ProjectsController.GetProjects().ToList();

            foreach (var proj in projects)
            {
                if (
                    string.Compare(projectInfo.Id.ToString(), proj.GetProjectInfo().Id.ToString(),
                                   StringComparison.OrdinalIgnoreCase) != 0)
                {
                    continue;
                }

                CurrentProjectInfo = proj.GetProjectInfo();

                currentSelectedProject = proj;
                break;
            }

            SelectedProjectId = CurrentProjectInfo.Id.ToString();

            #region  |  get settings project reference  |

            var settingsProject = Settings.projects.FirstOrDefault(project => string.Compare(project.id, CurrentProjectInfo.Id.ToString(), StringComparison.OrdinalIgnoreCase) == 0);

            #endregion

            if (settingsProject == null)
            {
                #region  |  check create new project entry  |

                CurrentProject = new Project
                {
                    id              = CurrentProjectInfo.Id.ToString(),
                    name            = CurrentProjectInfo.Name,
                    description     = CurrentProjectInfo.Description,
                    createdAt       = Helper.GetStringFromDateTime(CurrentProjectInfo.CreatedAt.Date),
                    createdBy       = CurrentProjectInfo.CreatedBy,
                    location        = CurrentProjectInfo.LocalProjectFolder,
                    projectFileName = CurrentProjectInfo.Name + ".sdlproj",
                    sourceLanguage  = new Structures.LanguageProperty
                    {
                        id   = CurrentProjectInfo.SourceLanguage.CultureInfo.Name,
                        name = CurrentProjectInfo.SourceLanguage.DisplayName
                    },
                    targetLanguages = new List <Structures.LanguageProperty>()
                };


                #region  |  get source language  |

                #endregion

                #region  |  get target langauges  |

                foreach (var language in CurrentProjectInfo.TargetLanguages)
                {
                    var targetLanguage = new Structures.LanguageProperty
                    {
                        id   = language.CultureInfo.Name,
                        name = language.DisplayName
                    };

                    CurrentProject.targetLanguages.Add(targetLanguage);
                }
                #endregion

                #region  |  get files  |

                CurrentProject.translatableCount = 0;
                CurrentProject.referenceCount    = 0;
                CurrentProject.localizableCount  = 0;
                CurrentProject.unKnownCount      = 0;
                CurrentProject.files             = new List <FileProperty>();


                #region  |  get source files  |


                ProjectFile[] sourceFiles = null;

                try
                {
                    if (currentSelectedProject != null)
                    {
                        sourceFiles = currentSelectedProject.GetSourceLanguageFiles();
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                    try
                    {
                        if (currentSelectedProject != null)
                        {
                            sourceFiles = currentSelectedProject.GetTargetLanguageFiles();
                        }
                    }
                    catch (Exception exception)
                    {
                        Console.WriteLine(exception.Message);
                    }
                }
                if (sourceFiles != null)
                {
                    foreach (var sfile in sourceFiles)
                    {
                        var fileProperty = new FileProperty
                        {
                            name = sfile.Name,
                            path = sfile.LocalFilePath
                        };
                        switch (sfile.Role)
                        {
                        case FileRole.Localizable: fileProperty.fileType = FileProperty.FileType.Localizable; CurrentProject.localizableCount++; break;

                        case FileRole.Reference: fileProperty.fileType = FileProperty.FileType.Reference; CurrentProject.referenceCount++; break;

                        case FileRole.Translatable: fileProperty.fileType = FileProperty.FileType.Translatable; CurrentProject.translatableCount++; break;

                        case FileRole.Unknown: fileProperty.fileType = FileProperty.FileType.Unknown; CurrentProject.unKnownCount++; break;
                        }
                        fileProperty.sourceId = CurrentProjectInfo.SourceLanguage.CultureInfo.Name;
                        fileProperty.targetId = CurrentProjectInfo.SourceLanguage.CultureInfo.Name;
                        fileProperty.isSource = true;
                    }
                }

                #endregion


                #endregion

                #endregion
            }
            else
            {
                CurrentProject = (Project)settingsProject.Clone();
            }



            #region  |  new project version  |

            ProjectVersion = new ProjectVersion
            {
                id       = Guid.NewGuid().ToString(),
                parentId = CurrentProjectInfo.Id.ToString()
            };

            var existingNames = CurrentProject.projectVersions.Select(pv => pv.name).ToList();

            ProjectVersion.name        = Helper.GetUniqueName(CurrentProject.name, existingNames);
            ProjectVersion.description = CurrentProject.description;
            ProjectVersion.createdAt   = Helper.GetStringFromDateTime(DateTime.Now);
            ProjectVersion.createdBy   = CurrentProject.createdBy;

            ProjectVersion.shallowCopy     = Settings.create_shallow_copy;
            ProjectVersion.location        = Settings.versions_folder_path;
            ProjectVersion.projectFileName = CurrentProject.projectFileName;



            #region  |  get source language  |

            ProjectVersion.sourceLanguage = new Structures.LanguageProperty
            {
                id   = CurrentProjectInfo.SourceLanguage.CultureInfo.Name,
                name = CurrentProjectInfo.SourceLanguage.DisplayName
            };

            #endregion

            #region  |  get target langauges  |
            ProjectVersion.targetLanguages = new List <Structures.LanguageProperty>();
            foreach (var language in CurrentProjectInfo.TargetLanguages)
            {
                var targetLanguage = new Structures.LanguageProperty
                {
                    id   = language.CultureInfo.Name,
                    name = language.DisplayName
                };

                ProjectVersion.targetLanguages.Add(targetLanguage);
            }
            #endregion

            #region  |  get files  |
            ProjectVersion.translatableCount = 0;
            ProjectVersion.referenceCount    = 0;
            ProjectVersion.localizableCount  = 0;
            ProjectVersion.unKnownCount      = 0;
            ProjectVersion.files             = new List <FileProperty>();
            #region  |  get source files  |

            ProjectVersion.localizableCount  = CurrentProject.localizableCount;
            ProjectVersion.referenceCount    = CurrentProject.referenceCount;
            ProjectVersion.translatableCount = CurrentProject.translatableCount;
            ProjectVersion.unKnownCount      = CurrentProject.unKnownCount;

            #endregion

            #endregion

            #endregion

            textBox_name.Text                       = ProjectVersion.name;
            textBox_location.Text                   = ProjectVersion.location;
            textBox_description.Text                = ProjectVersion.description;
            textBox_createdAt.Text                  = ProjectVersion.createdAt;
            checkBox_createShallowCopy.Checked      = ProjectVersion.shallowCopy;
            checkBox_createSubFolderProject.Checked = true;
        }
コード例 #36
0
        /// <summary>
        ///   Provides the updated version as a string.
        /// </summary>
        /// <param name="projectInfo">
        ///   <c>ProjectInfo</c> for the project that is updated.
        /// </param>
        /// <param name="assemblyVersionType">
        ///   <c>AssemblyVersionType</c> for which version update is done.
        /// </param>
        /// <param name="highestProjectVersion">
        ///   Highest <c>ProjectVersion</c> used as a reference for update.
        /// </param>
        /// <returns>
        ///   New version as a string.
        /// </returns>
        public string ProvideNewVersion(ProjectInfo projectInfo, AssemblyVersionType assemblyVersionType, ProjectVersion highestProjectVersion)
        {
            Debug.Assert(assemblyVersionType != AssemblyVersionType.All);
            switch (m_numberingOptions.BatchCommandIncrementScheme)
            {
            case BatchCommandIncrementScheme.IncrementModifiedIndependently:
            case BatchCommandIncrementScheme.IncrementAllIndependently:
                if (m_numberingOptions.SynchronizeAllVersionTypes && !projectInfo.ToUpdate)
                {
                    return(projectInfo.CurrentAssemblyVersions.HighestProjectVersion.ToString());
                }
                return(projectInfo.ToBecomeAssemblyVersions[assemblyVersionType].ToString());

            case (BatchCommandIncrementScheme.IncrementAllAndSynchronize):
            case (BatchCommandIncrementScheme.IncrementModifiedOnlyAndSynchronize):
                int resetBuildAndRevisionValues = (int)m_numberingOptions.ResetBuildAndRevisionTo;
                return(ProjectVersion.ApplyVersionPattern(highestProjectVersion.ToString(), projectInfo.CurrentAssemblyVersions[assemblyVersionType].ToString(), resetBuildAndRevisionValues));// highestProjectVersion.ToString();
            }
            Debug.Assert(false, "Not supported option");
            return(null);
        }
コード例 #37
0
        private bool ProjectFilter(object item)
        {
            ProjectVersion proj = item as ProjectVersion;

            return(string.IsNullOrEmpty(Filter) || proj.Name.CaseContains(Filter, StringComparison.InvariantCultureIgnoreCase));
        }
コード例 #38
0
        private void ProjectVersionAddTestCase(bool released)
        {
            const string VersionName = "VersionName";
            const string VersionDescription = "VersionDescription";
            DateTime now = DateTime.Today;  // Use today to avoid approximation errors

            ProjectVersion version = new ProjectVersion();
            version.ProjectId = this.FirstProjectId;
            version.Name = VersionName;
            version.Description = VersionDescription;
            version.DateOrder = now;
            version.IsReleased = released;

            int versionId = Session.Request.ProjectVersionAdd(version);

            try
            {
                // Check that the version id is set.
                Assert.AreEqual(versionId, version.Id);
                Assert.AreNotEqual(versionId, 0);

                ProjectVersion versionAdded = GetProjectVersionById(versionId);

                Assert.AreEqual(versionId, versionAdded.Id);
                Assert.AreEqual(VersionName, versionAdded.Name);
                Assert.AreEqual(VersionDescription, versionAdded.Description);
                Assert.AreEqual(now, versionAdded.DateOrder);
                Assert.AreEqual(released, versionAdded.IsReleased);
            }
            finally
            {
                Session.Request.ProjectVersionDelete(versionId);
            }
        }
コード例 #39
0
 public override Versioning.IExolutioCloneable Clone(ProjectVersion projectVersion, Versioning.ElementCopiesMap createdCopies)
 {
     return(new PSMSchemaClassViewHelper(projectVersion.Project.TranslateComponent <Diagram>(createdCopies.GetGuidForCopyOf(Diagram))));
 }
コード例 #40
0
 public virtual IExolutioCloneable Clone(ProjectVersion projectVersion, ElementCopiesMap createdCopies)
 {
     throw new NotImplementedException(string.Format("Clone is not implemented for type {0}.", this.GetType().Name));
 }
コード例 #41
0
 public override IExolutioCloneable Clone(ProjectVersion projectVersion, ElementCopiesMap createdCopies)
 {
     return(new PSMClass(projectVersion.Project, createdCopies.SuggestGuid(this)));
 }
コード例 #42
0
 public ObjectBaseConvertedEvent(IObjectBase convertedObject, ProjectVersion fromVersion)
 {
     ConvertedObject = convertedObject;
     FromVersion     = fromVersion;
 }