LoginServer.Systems.getarticle C# (CSharp) Method

getarticle() public static method

public static getarticle ( string title ) : NewsList
title string
return NewsList
        public static NewsList getarticle(string title)
        {
            foreach (NewsList article in News_List)
            {
                if (article.Head == title) return article;
            }
            return null;
        }

Usage Example

コード例 #1
0
 private void editNews_Click(object sender, EventArgs e)
 {
     if (nwsList.SelectedItem == null)
     {
         MessageBox.Show("You must first select a news item to edit..", "[SRX]", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
     else
     {
         //Populate informational gui boxes
         NewsList article = Systems.getarticle(nwsList.SelectedItem.ToString());
         nwsTitle.Text = article.Head;
         nwsBody.Text  = article.Msg;
     }
 }