티스토리 뷰

c sharp programing at 2 teardown



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;


Using

use system resource that this program require.


//Date: 15 October 2017
//This program will create a database of games.
//all games will be saved to an WML file.
//If the file does not exist then a default file will be ceated.

Comment

This area is comment for entire explanation about the program. Such as when it's created or function.


namespace AT2
{

namespace

It define entire application area. In this program, it's name is AT2


public partial class Form1 : Form
    {


Form class

Using to making form application .


public Form1()
        {
            InitializeComponent();
        }

InitializeComponent()

As i made windows form application, this method work as calling form component.


        List<Game> mygames = new List<Game>();

List

Similar to array, it has unfixed length, the name of the list is mygames. using class Game.


        private void btnAdd_Click(object sender, EventArgs e)
        {
            bool hasData = true;
            Game m = new Game();


Private

The variables in this method won't affect or used outside of the method.


Void

This method won't output result.


Bool

It has only two value; true or false.


Game m

It makes new element in class Game named m.


m.GameName = textBoxName.Text; if (String.IsNullOrEmpty(textBoxName.Text)) { MessageBox.Show("Please enter Game Name"); hasData = false; return; }

textBoxName.Text

Get the value of the textbox named textBoxName and put to m.GameName list.


If()

When the statement inside it, run it.


IsNullOrEmpty

Check the variable that given and output ture if it has value


'AU Study > TAFE Assessment' 카테고리의 다른 글

Router configuration Using Putty  (0) 2017.11.15
Driving website project  (0) 2017.10.28
C sharp programming AT 1.1  (0) 2017.10.25
C sharp programming AT 1.2  (0) 2017.10.25
C sharp programming AT 1.4  (0) 2017.10.25
댓글
Announcement
Recent Posts
Recent Comments
Total
Today
Yesterday
Link
TAG
more
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Search by month