本文整理汇总了C#中Album类的典型用法代码示例。如果您正苦于以下问题:C# Album类的具体用法?C# Album怎么用?C# Album使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Album类属于命名空间,在下文中一共展示了Album类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AmazonAlbumLookup
public Album AmazonAlbumLookup(string albumId)
{
Album album = new Album();
var helper = new SignedRequestHelper(Options.MainSettings.AmazonSite);
string requestString = helper.Sign(string.Format(itemLookup, albumId));
string responseXml = Util.GetWebPage(requestString);
if (responseXml == null)
return album;
XmlDocument xml = new XmlDocument();
xml.LoadXml(responseXml);
// Retrieve default Namespace of the document and add it to the NameSpacemanager
string defaultNameSpace = xml.DocumentElement.GetNamespaceOfPrefix("");
XmlNamespaceManager nsMgr = new XmlNamespaceManager(xml.NameTable);
nsMgr.AddNamespace("ns", defaultNameSpace);
XmlNodeList nodes = xml.SelectNodes("/ns:ItemLookupResponse/ns:Items/ns:Item", nsMgr);
if (nodes.Count > 0)
{
album = FillAlbum(nodes[0]);
}
return album;
}
开发者ID:MediaPortal,项目名称:MPTagThat,代码行数:25,代码来源:Amazon.cs
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
user = Membership.GetUser();
if (user != null)
userName = user.UserName;
if (Request.Params.AllKeys.Contains<string>("id"))
{
photoId = int.Parse(Request.Params.Get("id"));
try
{
photo = new Photo(photoId);
album = photo.getAlbum();
photoUrl = "Photos/" + photo.getId() + ".jpg";
comments = photo.getComments();
}
catch (Exception ex)
{
Response.Redirect("Default.aspx");
}
}
else
{
Response.Redirect("Default.aspx");
}
}
开发者ID:hasnarobert,项目名称:Share-Photos,代码行数:28,代码来源:PhotoWall.aspx.cs
示例3: Album
public Album(Album a)
{
this.setid = a.setid;
this.title = a.title;
this.desc = a.desc;
this.photoid = a.photoid;
}
开发者ID:joshuacox,项目名称:dfo,代码行数:7,代码来源:Album.cs
示例4: ExecuteInsertMediaCommand
protected override void ExecuteInsertMediaCommand(string[] commandWords)
{
switch (commandWords[2])
{
case "album":
var performer = this.performers.FirstOrDefault(p => p.Name == commandWords[5]);
if (performer == null)
{
this.Printer.PrintLine("The performer does not exist in the database.");
return;
}
var album = new Album(
commandWords[3],
decimal.Parse(commandWords[4]),
performer, commandWords[6],
int.Parse(commandWords[7]));
this.InsertAlbum(album, performer);
break;
default:
base.ExecuteInsertMediaCommand(commandWords);
break;
}
}
开发者ID:IskraNikolova,项目名称:Object-oriented-programming,代码行数:25,代码来源:MyNewTunesEngine.cs
示例5: AlbumWithArchivedVersionsContract
public AlbumWithArchivedVersionsContract(Album album, ContentLanguagePreference languagePreference)
: base(album, languagePreference)
{
ParamIs.NotNull(() => album);
ArchivedVersions = album.ArchivedVersionsManager.Versions.Select(a => new ArchivedAlbumVersionContract(a)).ToArray();
}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:7,代码来源:AlbumWithArchivedVersions.cs
示例6: Modify
public void Modify(Album album)
{
if (album == null)
throw new ArgumentNullException("album");
_repository.Update(album);
}
开发者ID:dlovesl,项目名称:MusicStore,代码行数:7,代码来源:AlbumService.cs
示例7: ReadMyXML
public async void ReadMyXML(string year, string month)
{
Albums = new Albums();
Progress<int> progress = new Progress<int>((p) => { ProgressPercent = p; });
BasicFileDownloader bidl = new BasicFileDownloader(ToAbsoluteUri("xmlalbums.aspx?ay=" + year + "&am=" + month));
IRandomAccessStream s = await bidl.DownloadAsync(progress);
XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Fragment;
settings.IgnoreWhitespace = true;
settings.IgnoreComments = true;
settings.Async = true;
XmlReader reader = XmlReader.Create(s.AsStream(), settings);
reader.ReadStartElement("Model");
reader.ReadStartElement("Albums");
Count = 0;
while (reader.IsStartElement())
{
string albumid = reader[0];
string album = reader[2];
string str = reader[1];
str = str.Replace("_s.jpg", "");
uint count = 0;
if (uint.TryParse(reader[3], out count))
{
Album m = new Album(albumid, album, str, count);
Albums.Add(m);
Count += m.Count;
}
await reader.ReadAsync();
}
}
开发者ID:sujalp,项目名称:Win8PV,代码行数:34,代码来源:AlbumsViewModel.cs
示例8: Validate
public static ValidationResult Validate(Album album)
{
ParamIs.NotNull(() => album);
var errors = new List<string>();
if (album.CoverPictureData == null)
errors.Add(AlbumValidationErrors.NeedCover);
if (album.DiscType == DiscType.Unknown)
errors.Add(AlbumValidationErrors.NeedType);
if (album.Artists.All(a => a.Artist == null))
errors.Add(AlbumValidationErrors.NeedArtist);
if (album.Names.Names.All(n => n.Language == ContentLanguageSelection.Unspecified))
errors.Add(AlbumValidationErrors.UnspecifiedNames);
if (album.OriginalReleaseDate.IsEmpty)
errors.Add(AlbumValidationErrors.NeedReleaseYear);
if (!album.Songs.Any())
errors.Add(AlbumValidationErrors.NeedTracks);
return new ValidationResult(errors);
}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:26,代码来源:AlbumValidator.cs
示例9: PlayListElems
public PlayListElems(Artist aid, Album alid, TrackList trid)
{
ArtistName = (string)aid.ArtistName;
AlbumName = (string)alid.AlbumName;
TrackNum = (string)trid.TrackNum;
TrackName = (string)trid.TrackName;
}
开发者ID:Apolotary,项目名称:GinTunes,代码行数:7,代码来源:PlayListElems.cs
示例10: AddAlbum
public bool AddAlbum(Album album)
{
using (var connection = new SqlConnection(this.connectionString))
{
var storeProcedure = "Album_AddAlbum";
var command = new SqlCommand(storeProcedure, connection)
{
CommandType = CommandType.StoredProcedure
};
command.Parameters.AddWithValue("@name", album.Name);
var dateParameter = new SqlParameter("@date", SqlDbType.DateTime);
dateParameter.Value = album.Date;
command.Parameters.Add(dateParameter);
command.Parameters.AddWithValue("@userId", album.UserId);
connection.Open();
var reader = command.ExecuteReader();
if (reader.Read())
{
album.Id = (int)(decimal)reader["newId"];
return true;
}
else
{
return false;
}
}
}
开发者ID:MasterOfDeath,项目名称:XT2015-5,代码行数:30,代码来源:AlbumSqlStore.cs
示例11: ToEntity
public static Db.Album ToEntity(Album album)
{
if (album != null)
{
var media = new List<DataAccess.Database.Entities.Objects.Media>();
if (album.Media != null)
{
media = album.Media.Select(MediaMapper.ToEntity).ToList();
}
return new Db.Album
{
AlbumId = album.AlbumId,
AlbumName = album.AlbumName,
Media = media,
UserId = album.User.Id,
IsUserDefault = album.IsUserDefault,
CreatedBy = album.CreatedBy,
CreatedDate = album.CreatedDate,
ModifiedBy = album.ModifiedBy,
ModifiedDate = album.ModifiedDate
};
}
return null;
}
开发者ID:jsnmgpnty,项目名称:Blogness2.0,代码行数:25,代码来源:AlbumMapper.cs
示例12: PutAlbum
// PUT api/Albums/5
public HttpResponseMessage PutAlbum(int id, Album album)
{
if (!ModelState.IsValid)
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
}
if (id != album.AlbumId)
{
return Request.CreateResponse(HttpStatusCode.BadRequest);
}
db.Entry(album).State = EntityState.Modified;
try
{
db.SaveChanges();
}
catch (DbUpdateConcurrencyException ex)
{
return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
}
return Request.CreateResponse(HttpStatusCode.OK);
}
开发者ID:NikolayKostadinov,项目名称:Homeworks,代码行数:26,代码来源:AlbumsController.cs
示例13: Add
/// <summary>
/// Adds a new album to the database.
/// </summary>
/// <param name="creatorName">The username(email) of the requesting user.</param>
/// <returns>The id of the created album.</returns>
public int Add(Album newAlbum, string creatorName)
{
if (creatorName == null)
{
throw new ArgumentNullException("Creator name must be specified.");
}
if (newAlbum == null)
{
throw new ArgumentNullException("Album cannot be null.");
}
var currentUser = this.data.Users
.All()
.FirstOrDefault(u => u.UserName == creatorName);
if (currentUser == null)
{
throw new ArgumentException("No user with this username found.");
}
newAlbum.CreatedOn = DateTime.Now;
newAlbum.Owner = currentUser;
this.data.Albums.Add(newAlbum);
this.data.SaveChanges();
return newAlbum.Id;
}
开发者ID:TeamApollo,项目名称:Image-Gallery,代码行数:34,代码来源:AlbumsService.cs
示例14: btnSubmit_Click
public void btnSubmit_Click(object sender, EventArgs e)
{
if (EmptyNullUndefined(txtAlbumName.Text) || ddlYearReleased.SelectedValue == "-1")
return;
var album = new Album
{
AlbumId = Guid.NewGuid(),
AlbumName = txtAlbumName.Text,
CreatedDate = DateTime.UtcNow,
YearReleased = int.Parse(ddlYearReleased.SelectedValue)
};
var albumService = new AlbumService(Ioc.GetInstance<IAlbumRepository>());
bool success;
albumService.SaveCommit(album, out success);
if (success)
{
var scriptHelper = new ScriptHelper("SuccessAlert", "alertDiv", "You have successfully created an album.");
Page.RegisterStartupScript(scriptHelper.ScriptName, scriptHelper.GetSuccessScript());
}
else
{
var scriptHelper = new ScriptHelper("ErrorAlert", "alertDiv", "There was an error, try again later.");
Page.RegisterStartupScript(scriptHelper.ScriptName, scriptHelper.GetFatalScript());
}
}
开发者ID:coredweller,项目名称:PhishMarket,代码行数:29,代码来源:CreateAlbum.aspx.cs
示例15: AlbumEditorUI
private AlbumEditorUI(Album album, bool isnew)
{
Glade.XML gxml = new Glade.XML (null, "organizer.glade", "window3", null);
gxml.Autoconnect (this);
this._isnew = isnew;
this._album = album;
window3.Title = String.Format("Editing information for {0}", album.Title);
window3.SetIconFromFile(DeskFlickrUI.ICON_PATH);
label8.Text = "Edit";
label9.Text = "Title: ";
label10.Text = "Description: ";
entry3.Text = album.Title;
textview6.Buffer.Text = album.Desc;
entry3.Changed += new EventHandler(OnTitleChanged);
textview6.Buffer.Changed += new EventHandler(OnDescriptionChanged);
button7.Clicked += new EventHandler(OnCancelButtonClicked);
button8.Clicked += new EventHandler(OnSaveButtonClicked);
image4.Pixbuf = PersistentInformation.GetInstance()
.GetSmallImage(album.PrimaryPhotoid);
window3.ShowAll();
}
开发者ID:joshuacox,项目名称:dfo,代码行数:27,代码来源:AlbumEditorUI.cs
示例16: PlayListElems
public PlayListElems(Artist aid, Album alid, TrackList trid)
{
artistName = (string)aid.artistName;
albumName = (string)alid.albumName;
trackNum = (string)trid.trackNum;
trackName = (string)trid.trackName;
}
开发者ID:Apolotary,项目名称:GinTunes,代码行数:7,代码来源:PlayListElems.cs
示例17: CreateAlbum
public CreateAlbumResponse CreateAlbum(CreateAlbumRequest request)
{
var response = new CreateAlbumResponse();
var album = new Album
{
Genre = _genreRepository.FindBy(request.GenreId),
Artist = _artistRepository.FindBy(request.ArtistId),
Title = request.Title,
Description = request.Description,
Price = request.Price,
AlbumArtUrl = request.AlbumArtUrl
};
ThrowExceptionIfAlbumIsInvalid(album);
_albumRepository.Add(album);
_uow.Commit();
MvcSiteMapProvider.SiteMaps.ReleaseSiteMap();
response.Album = album.ConvertToAlbumView();
return response;
}
开发者ID:kduberstein,项目名称:MvcMusicStore,代码行数:26,代码来源:AlbumService.cs
示例18: AddToCart
public void AddToCart(Album album)
{
// Get the matching cart and album instances
var cartItem = storeDB.Carts.SingleOrDefault(c => c.CartId == ShoppingCartId && c.AlbumId == album.Id);
if (cartItem == null)
{
// Create a new cart item if no cart item exists
cartItem = new Cart
{
AlbumId = album.Id,
CartId = ShoppingCartId,
Count = 1,
DateCreated = DateTime.Now
};
storeDB.Carts.Add(cartItem);
}
else
{
// If the item does exist in the cart, then add one to the quantity
cartItem.Count++;
}
// Save changes
storeDB.SaveChanges();
}
开发者ID:minipax,项目名称:Merriweather,代码行数:27,代码来源:ShoppingCart.cs
示例19: EntryForApiContract
public EntryForApiContract(Album album, ContentLanguagePreference languagePreference, IEntryThumbPersister thumbPersister, bool ssl,
EntryOptionalFields includedFields)
: this(album, languagePreference) {
ArtistString = album.ArtistString[languagePreference];
CreateDate = album.CreateDate;
DiscType = album.DiscType;
Status = album.Status;
if (includedFields.HasFlag(EntryOptionalFields.MainPicture) && album.CoverPictureData != null) {
MainPicture = new EntryThumbForApiContract(new EntryThumb(album, album.CoverPictureMime), thumbPersister, ssl);
}
if (includedFields.HasFlag(EntryOptionalFields.Names)) {
Names = album.Names.Select(n => new LocalizedStringContract(n)).ToArray();
}
if (includedFields.HasFlag(EntryOptionalFields.Tags)) {
Tags = album.Tags.Usages.Select(u => new TagUsageForApiContract(u)).ToArray();
}
if (includedFields.HasFlag(EntryOptionalFields.WebLinks)) {
WebLinks = album.WebLinks.Select(w => new ArchivedWebLinkContract(w)).ToArray();
}
}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:26,代码来源:EntryForApiContract.cs
示例20: AlbumForApiContract
public AlbumForApiContract(
Album album, AlbumMergeRecord mergeRecord,
ContentLanguagePreference languagePreference,
IEntryThumbPersister thumbPersister,
bool ssl,
AlbumOptionalFields fields) : this(album, mergeRecord, languagePreference,
fields.HasFlag(AlbumOptionalFields.Artists),
fields.HasFlag(AlbumOptionalFields.Names),
fields.HasFlag(AlbumOptionalFields.PVs),
fields.HasFlag(AlbumOptionalFields.Tags),
fields.HasFlag(AlbumOptionalFields.WebLinks)) {
if (languagePreference != ContentLanguagePreference.Default || fields.HasFlag(AlbumOptionalFields.AdditionalNames)) {
AdditionalNames = album.Names.GetAdditionalNamesStringForLanguage(languagePreference);
}
if (fields.HasFlag(AlbumOptionalFields.Identifiers)) {
Identifiers = album.Identifiers.Select(i => new AlbumIdentifierContract(i)).ToArray();
}
if (thumbPersister != null && fields.HasFlag(AlbumOptionalFields.MainPicture) && !string.IsNullOrEmpty(album.CoverPictureMime)) {
MainPicture = new EntryThumbForApiContract(new EntryThumb(album, album.CoverPictureMime), thumbPersister, ssl);
}
}
开发者ID:realzhaorong,项目名称:vocadb,代码行数:27,代码来源:AlbumForApiContract.cs
注:本文中的Album类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论