Exemplo n.º 1
0
        public int AssignAssetToProject(ProjectAsset projectAsset)
        {
            string sql =
                $@"INSERT INTO [dbo].[Project_Asset]([Project_Asset_Id], [Note], [Added_Datetime], [Project_Id], [Asset_Id]) VALUES (@Project_Asset_Id, @Note, @Added_Datetime, '{projectAsset.Project.Project_Id}', '{projectAsset.Asset.Asset_Id}');";

            return(_unitOfWork.Connection.Execute(sql, projectAsset, _unitOfWork.Transaction));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create the Lucene document and index fields common to a ProjectAsset object.
        /// Stories, Defects, Requests, and Issues inherit from ProjectAsset
        /// </summary>
        /// <param name="projectAsset">ProjectAsset to index</param>
        /// <returns></returns>
        private Document CreateDocument(ProjectAsset projectAsset)
        {
            Document doc = new Document();

            doc.Add(UnIndexed("URL", _v1Url + "/assetdetail.v1?oid=" + projectAsset.ID));
            doc.Add(Keyword("ID", projectAsset.DisplayID));
            doc.Add(UnStored("OID", projectAsset.ID));
            doc.Add(Text("type", projectAsset.GetType().Name));
            doc.Add(Text("isClosed", projectAsset.IsClosed.ToString()));
            doc.Add(Text("Name", projectAsset.Name));
            doc.Add(UnStored("Description", projectAsset.Description));
            if (null != projectAsset.Project)
            {
                doc.Add(Text("Project", projectAsset.Project.Name));
            }

            StringBuilder noteBuffer = new StringBuilder();

            foreach (Note note in projectAsset.GetNotes(null))
            {
                noteBuffer.Append(note.Name);
            }
            doc.Add(UnStored("Notes", noteBuffer.ToString()));

            return(doc);
        }
Exemplo n.º 3
0
            string ResolutionDisplayStringForAsset(ProjectAsset asset)
            {
                var projectResolution = "{";

                projectResolution += asset.Asset1x == null ? "" : " x1 ";
                projectResolution += asset.Asset2x == null ? "" : " x2 ";
                projectResolution += asset.Asset3x == null ? "" : " x3 ";
                projectResolution += "}";

                return(projectResolution);
            }
Exemplo n.º 4
0
        internal override void Add(ProjectAsset asset)
        {
            var drawable = new Drawable {
                Name = asset.Name
            };

            drawable.AssetPaths.Add(Drawable.DrawableDPI.HDPI, asset.Asset1x.Path);
            drawable.AssetPaths.Add(Drawable.DrawableDPI.XHDPI, asset.Asset2x.Path);
            drawable.AssetPaths.Add(Drawable.DrawableDPI.XXHDPI, asset.Asset3x.Path);
            Parser.Add(drawable);
        }
Exemplo n.º 5
0
 public static ModifiedProjectAsset FromAsset(ProjectAsset asset)
 {
     return(new ModifiedProjectAsset
     {
         Name = asset.Name,
         Project = asset.Project,
         Asset1x = asset.Asset1x,
         Asset2x = asset.Asset2x,
         Asset3x = asset.Asset3x
     });
 }
Exemplo n.º 6
0
        public void It_can_have_assets_added_to_it()
        {
            var directoryAccessor = new InMemoryDirectoryAccessor();

            var package = new Package2("the-package", directoryAccessor);

            var projectAsset = new ProjectAsset(directoryAccessor);

            package.Add(projectAsset);

            package.Assets.Should().Contain(a => a == projectAsset);
        }
Exemplo n.º 7
0
        public void An_asset_must_be_in_a_subdirectory_of_the_package()
        {
            var directoryAccessor = new InMemoryDirectoryAccessor();

            var package = new Package2("1", directoryAccessor.GetDirectoryAccessorForRelativePath("1"));

            var projectAsset = new ProjectAsset(directoryAccessor.GetDirectoryAccessorForRelativePath("2"));

            package.Invoking(p => p.Add(projectAsset)).Should()
            .Throw <ArgumentException>()
            .And
            .Message
            .Should()
            .StartWith("Asset must be located under package path");
        }
Exemplo n.º 8
0
        internal AssetProjectExpandedWidget(ProjectAsset asset)
        {
            Build();

            Asset = asset;

            ProjectNameLabel.ModifyFont(new FontDescription {
                Weight = Weight.Bold
            });
            ProjectNameLabel.Text = Asset.Project.Name;

            PopulateAssetItems();

            ShowAll();
        }
Exemplo n.º 9
0
 internal override void Delete(ProjectAsset asset)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 10
0
 internal override void Add(ProjectAsset image)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
 internal abstract void Delete(ProjectAsset asset);
Exemplo n.º 12
0
 internal abstract void Add(ProjectAsset image);
Exemplo n.º 13
0
        internal override void Delete(ProjectAsset asset)
        {
            var androidAsset = asset as AndroidProjectAsset;

            Parser.Delete(androidAsset.Drawable);
        }
 public AssetItemControl(ProjectAsset asset)
 {
     InitializeComponent();
     Asset = asset;
     UpdateDisplay();
 }
Exemplo n.º 15
0
 public Project()
 {
     this._assetFolder = new ProjectAsset(this);
     this._assetFolder.PropertyChanged += this.AssetFolder_PropertyChanged;
 }