public MainWindowControlleur(MainWindow a_vue)
        {
            if (MainWindowControlleur.Instance == null)
            {
                m_Instance = this;
            }
            else
            {
                throw new Exception("Singleton Object Cannot be instantiated twice!");
            }

            m_vue           = a_vue;
            SubReddits      = new List <SubReddit>();
            YoutubeChannels = new List <YoutubeChannel>();

            if (File.Exists(OldDataDirectory))
            {
                try {
                    XmlDocument t_Doc = new XmlDocument();
                    t_Doc.Load(OldDataDirectory);
                    if (t_Doc.DocumentElement.SelectSingleNode("/Data/Upgrade").InnerText == "1")
                    {
                        SQLiteDAO.upgrade(t_Doc);
                        File.Delete(OldDataDirectory);
                    }
                } catch (Exception e) { }
            }

            ReloadProfileButtons();
            LoadProfile(SQLiteDAO.LastConnectedProfile());
        }
Example #2
0
 public MainWindow()
 {
     InitializeComponent();
     m_controlleur = new MainWindowControlleur(this);
 }