Exemplo n.º 1
0
        public override void OnFieldDoubleClick(ShapeField field, DiagramPointEventArgs e)
        {
            string property_Name        = this.ModelElement.GetProperties()["Name"].GetValue(this.ModelElement.GetProperties()["Name"]).ToString();
            string property_Description = this.ModelElement.GetProperties()["Description"].GetValue(this.ModelElement.GetProperties()["Description"]).ToString();

            ISpySoft.SFSchemaLanguage.DomainModel.ArtifactType property_Type = (ISpySoft.SFSchemaLanguage.DomainModel.ArtifactType) this.ModelElement.GetProperties()["Type"].GetValue(this.ModelElement.GetProperties()["Type"]);

            ArtifactProperties artifactProperties = new ArtifactProperties();

            artifactProperties.NameTextBox        = property_Name;
            artifactProperties.DescriptionTextBox = property_Description;
            artifactProperties.TypeComboBox       = property_Type.ToString();

            if (artifactProperties.ShowDialog() == DialogResult.OK)
            {
                this.ModelElement.GetProperties()["Name"].SetValue(this.ModelElement.GetProperties()["Name"], artifactProperties.NameTextBox);
                this.ModelElement.GetProperties()["Description"].SetValue(this.ModelElement.GetProperties()["Description"], artifactProperties.DescriptionTextBox);
                switch (artifactProperties.TypeComboBox)
                {
                case "Asset":
                    this.ModelElement.GetProperties()["Type"].SetValue(this.ModelElement.GetProperties()["Type"], ISpySoft.SFSchemaLanguage.DomainModel.ArtifactType.Asset);
                    break;

                case "Tool":
                    this.ModelElement.GetProperties()["Type"].SetValue(this.ModelElement.GetProperties()["Type"], ISpySoft.SFSchemaLanguage.DomainModel.ArtifactType.Tool);
                    break;

                case "WorkProduct":
                    this.ModelElement.GetProperties()["Type"].SetValue(this.ModelElement.GetProperties()["Type"], ISpySoft.SFSchemaLanguage.DomainModel.ArtifactType.WorkProduct);
                    break;
                }
            }
        }
Exemplo n.º 2
0
        public ArtifactTemplate(Server server, ArtifactProperties artifact, BuildType buildType)
        {
            Server                    = server;
            PathRules                 = artifact.PathRules;
            RevisionName              = artifact.RevisionName;
            RevisionValue             = artifact.RevisionValue;
            SourceBuildTypeId         = artifact.SourceBuildTypeId ?? buildType.Id;
            CleanDestinationDirectory = artifact.CleanDestinationDirectory;
            Condition                 = Conditions.All;
            var tcServer = server as TeamCityApi;

            if (tcServer == null || !tcServer.Projects.ContainsKey(Config.ProjectId))
            {
                return;
            }
            Project = tcServer.Projects[Config.ProjectId];
        }