/// <summary> /// コンストラクター /// </summary> public ctlDBSystem() { this.InitializeComponent(); Common.EnableDoubleBuffering(this); //内部データベースの初期化 this.property = new DBProperty(); this.initInnerDB(); this.SupportedRowTools = false; this.DB.SelectedObject = this.property; }
/// <summary> /// XMLファイルからデータを読み込みます。 /// </summary> /// <returns>成功したかどうか</returns> private bool LoadXML(string fullPath) { if (File.Exists(fullPath)) { try { var serializer = new XmlSerializer(typeof(DBProperty)); using (var R = new StreamReader(Common.OpenFileReadOnly(fullPath), Common.SJIS)) { this.property = serializer.Deserialize(R) as DBProperty; } this.initInnerDB(); } catch { return(false); } this.DB.SelectedObject = this.property; return(true); } else { this.DB.SelectedObject = new DBProperty(); return(false); } }