Exemple #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 ();
    }
Exemple #2
0
        public virtual void ErrorLength(ServerWindow window, string channel, int length, bool small)
        {
            ChannelWindow chan = window.getChannel(channel);

            if (chan != null)
            {
                chan.printText("Error: " + Name() + " Args: " + length + (small ? " Not Enough Arguments." : " Too Many Arguments"));
            }
            else
            {
                Console.WriteLine("Error: " + Name() + " Args: " + length + (small ? " Not Enough Arguments." : " Too Many Arguments"));
            }
        }
Exemple #3
0
 void Channels_Joined(Object sender, JoinedEventArgs e)
 {
     if (StatusValue.InvokeRequired)
     {
         StatusValue.Invoke(new JoinedEventHandler(Channels_Joined), sender, e);
     }
     else
     {
         ChannelWindow chan;
         if (ChannelWindowsValue.ContainsKey(e.Channel.Name))
         {
             chan = ChannelWindowsValue[e.Channel.Name];
         }
         else
         {
             chan = new ChannelWindow(Status, e.Channel);
             ChannelWindowsValue.Add(chan.Channel.Name, chan);
             if (WindowOpened != null) WindowOpened(this, new WindowOpenedEventArgs(chan));
         }
         chan.Visible = true;
     }
 }