public static bool LoadLastProfile() { string name = LastProfileName; Profile p; if (!string.IsNullOrWhiteSpace(name)) { p = new Profile(name); if (p.Load()) { if (m_Current != null) { m_Current.Unload(); } m_Current = p; return(true); } } LastProfileName = "default"; p = new Profile("default"); if (!p.Load()) { p.MakeDefault(); p.Save(); } if (m_Current != null) { m_Current.Unload(); } m_Current = p; return(true); }
public static bool LoadProfile(string name) { Profile p = new Profile(name); if (p.Load()) { LastProfileName = p.Name; if (m_Current != null) { m_Current.Unload(); } m_Current = p; return(true); } else { return(false); } }
public static bool LoadLastProfile() { string name = LastProfileName; bool failed = true; Profile p = null; if (name != null) { p = new Profile(name); failed = !p.Load(); } if (failed) { if (p == null) { p = new Profile("default"); } else { p.Name = "default"; } if (!p.Load()) { p.MakeDefault(); p.Save(); } LastProfileName = "default"; } if (p != null) { if (m_Current != null) { m_Current.Unload(); } m_Current = p; } return(!failed); }
public static bool LoadProfile( string name ) { Profile p = new Profile( name ); if ( p.Load() ) { LastProfileName = p.Name; if ( m_Current != null ) m_Current.Unload(); m_Current = p; return true; } else { return false; } }
public static bool LoadLastProfile() { string name = LastProfileName; bool failed = true; Profile p = null; if ( name != null ) { p = new Profile( name ); failed = !p.Load(); } if ( failed ) { if ( p == null ) p = new Profile( "default" ); else p.Name = "default"; if ( !p.Load() ) { p.MakeDefault(); p.Save(); } LastProfileName = "default"; } if ( p != null ) { if ( m_Current != null ) m_Current.Unload(); m_Current = p; } return !failed; }