Click here to Skip to main content
15,881,424 members
Articles / Desktop Programming / Windows Forms

Saving Tree Structure using Serialization

Rate me:
Please Sign up or sign in to vote.
4.60/5 (4 votes)
22 Jun 2009CPOL5 min read 53K   1.7K   32  
This article demonstrates editing a tree structure and saving the job using serialization.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HostApp
{    
    public partial class frmEditInfo : Form
    {
        #region User Defined variable
        string tagValue = String.Empty;
        string nameValue = String.Empty;
        #endregion
        #region user Defined Property
        public string TagValue
        {
            get { return tagValue; }
            set { tagValue = value; }
        }
        public string NameValue
        {
            get { return nameValue; }
            set { nameValue = value; }
        }
        #endregion
        public frmEditInfo()
        {
            InitializeComponent();
        }

        private void frmEditInfo_Load(object sender, EventArgs e)
        {
            txtname.Text = nameValue;
            txtTag.Text = tagValue;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            nameValue = txtname.Text;
            tagValue = txtTag.Text;
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.No;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
Sid loves programming and has technical experience developing desktop based solutions using C#.Net, Winforms, WPF.
He has experience of Software services, I-Banks and Product development environments.
He also has a deep understanding of Product Development Lifecycle and Agile methodology of developing softwares.

Besides programming he is also fond of music, photography and cooking.
He lives in Bangalore.

Comments and Discussions