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)); }
/// <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); }
string ResolutionDisplayStringForAsset(ProjectAsset asset) { var projectResolution = "{"; projectResolution += asset.Asset1x == null ? "" : " x1 "; projectResolution += asset.Asset2x == null ? "" : " x2 "; projectResolution += asset.Asset3x == null ? "" : " x3 "; projectResolution += "}"; return(projectResolution); }
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); }
public static ModifiedProjectAsset FromAsset(ProjectAsset asset) { return(new ModifiedProjectAsset { Name = asset.Name, Project = asset.Project, Asset1x = asset.Asset1x, Asset2x = asset.Asset2x, Asset3x = asset.Asset3x }); }
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); }
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"); }
internal AssetProjectExpandedWidget(ProjectAsset asset) { Build(); Asset = asset; ProjectNameLabel.ModifyFont(new FontDescription { Weight = Weight.Bold }); ProjectNameLabel.Text = Asset.Project.Name; PopulateAssetItems(); ShowAll(); }
internal override void Delete(ProjectAsset asset) { throw new NotImplementedException(); }
internal override void Add(ProjectAsset image) { throw new NotImplementedException(); }
internal abstract void Delete(ProjectAsset asset);
internal abstract void Add(ProjectAsset image);
internal override void Delete(ProjectAsset asset) { var androidAsset = asset as AndroidProjectAsset; Parser.Delete(androidAsset.Drawable); }
public AssetItemControl(ProjectAsset asset) { InitializeComponent(); Asset = asset; UpdateDisplay(); }
public Project() { this._assetFolder = new ProjectAsset(this); this._assetFolder.PropertyChanged += this.AssetFolder_PropertyChanged; }