Пример #1
0
    public MainClass()
    {
        userdir = Path.Combine (
            Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
            "Monopod");

        // check userdir exists, make if not
        if (!Directory.Exists (userdir)) {
            DirectoryInfo d = Directory.CreateDirectory (userdir);
            if ( d == null ) {
                // TODO: throw a wobbly
            }
        }
        store = new Store (Path.Combine (userdir, ".monopod.db"), userdir);
        if (store.NumberOfChannels == 0) {
            store.AddDefaultChannels ();
            channels = new ChannelWindow (store);
            channels.Show ();
        } else {
            channels = new ChannelWindow (store);
        }
        #if USING_IPOD
        ipodwindow = new IPodChooseWindow (store);
        #endif
        InitIcon ();
        InitMenu ();

        // kick off downloading
        store.FetchNextChannel ();
        store.FetchNextCast ();
    }