protected void Set( string fieldName, InstanceSetting setting) { if (fieldName == null) { throw new ArgumentNullException(); } if (setting == null) { throw new ArgumentNullException(); } this._instances[fieldName] = setting; }
public void Load() { try { XmlSerializer serializer = new XmlSerializer( typeof( InstanceSetting ) ); TextReader textReader = new StreamReader( Directory.GetCurrentDirectory() + @"\..\Data\" + this.GetType() + "InstanceSetting.xml" ); instanceSetting = ( InstanceSetting )serializer.Deserialize( textReader ); textReader.Close(); this.StartPosition = FormStartPosition.Manual; this.DesktopBounds = instanceSetting.DesktopBounds; this.WindowState = instanceSetting.WindowState; this.Visible = instanceSetting.Visible; } catch( Exception ex ) { MessageBox.Show( this, ex.ToString() ); } }
protected void Set( string fieldName, InstanceSetting setting) { if (fieldName == null) throw new ArgumentNullException(); if (setting == null) throw new ArgumentNullException(); this._instances[fieldName] = setting; }