Exemple #1
0
        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);
        }
Exemple #2
0
        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);
            }
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 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;
     }
 }
Exemple #5
0
        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;
        }