예제 #1
0
        public ConstantsForm()
        {
            InitializeComponent();

            this.data = ConstantsHolder.Singleton;
            this.propertyGrid.SelectedObject = this.data;
        }
예제 #2
0
        public ConstantsForm()
        {
            InitializeComponent();

            this.data = ConstantsHolder.Singleton;
            this.propertyGrid.SelectedObject = this.data;
        }
예제 #3
0
        /// <summary>
        /// Opens the instance stored in the saveFile
        /// </summary>
        /// <returns>red class instance</returns>
        private static ConstantsHolder OpenXml()
        {
            StreamReader R = null;

            try
            {
                XmlSerializer S = new XmlSerializer(typeof(ConstantsHolder));
                R = new StreamReader(saveFile);
                ConstantsHolder ch = (ConstantsHolder)S.Deserialize(R);
                R.Close();

                return(ch);
            }
            catch//(Exception ex)
            {
                if (R != null)
                {
                    R.Close();
                }
                Console.WriteLine("unable to load");
                //System.Windows.Forms.MessageBox.Show(ex.ToString());
                return(null);
            }
        }
예제 #4
0
 /// <summary>
 /// To create the first xml
 /// </summary>
 public static void Main()
 {
     ConstantsHolder ch = new ConstantsHolder();
     ch.SaveXml();
 }
예제 #5
0
        /// <summary>
        /// To create the first xml
        /// </summary>
        public static void Main()
        {
            ConstantsHolder ch = new ConstantsHolder();

            ch.SaveXml();
        }