当前位置: 首页>>代码示例>>C#>>正文


C# Album类代码示例

本文整理汇总了C#中Album的典型用法代码示例。如果您正苦于以下问题:C# Album类的具体用法?C# Album怎么用?C# Album使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Album类属于命名空间,在下文中一共展示了Album类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的Album类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。