Exemple #1
0
        /// <snd what='file' id='10' part='13'>...</snd>
        private void OnSndEvent(PeerSocket peer, XmlRequest xml)
        {
            Gtk.Application.Invoke(delegate {
                string what = (string)xml.Attributes["what"];

                switch (what)
                {
                case "file":
                    ulong id = ulong.Parse((string)xml.Attributes["id"]);
                    DownloadManager.GetFilePart(peer, id, xml);
                    break;

                case "file-list":
                    UserInfo userInfo         = peer.Info as UserInfo;
                    FolderViewer folderViewer = notebookViewer.LookupPage(userInfo);
                    folderViewer.Fill((string)xml.Attributes["path"], xml.BodyText);
                    break;
                }
            });
        }
        public void OnSndEvent(PeerSocket peer, XmlRequest xml)
        {
            Gtk.Application.Invoke(delegate {
                string what = (string)xml.Attributes["what"];

                if (what == "folder-list")
                {
                    UserInfo userInfo         = peer.Info as UserInfo;
                    FolderViewer folderViewer = notebookViewer.LookupPage(userInfo);
                    folderViewer.Fill((string)xml.Attributes["path"], xml.BodyText);
                }
                else if (what == "file")
                {
                    try {
                        DownloadManager.GetFilePart(peer, xml);
                    } catch (Exception e) {
                        Glue.Dialogs.MessageError("Download File Part", e.Message);
                    }
                }
            });
        }
Exemple #3
0
        private void LoadImage(UserInfo userInfo, string path, Gdk.Pixbuf pixbuf)
        {
            // Lookup File Iter
            FolderViewer folderViewer = notebookViewer.LookupPage(userInfo);

            if (folderViewer == null)
            {
                return;
            }

            // Get File Tree Iter
            Gtk.TreeIter iter = folderViewer.Store.GetIter(path);
            if (iter.Equals(Gtk.TreeIter.Zero))
            {
                return;
            }

            // Build & Set Thumb Image
            Gtk.Application.Invoke(delegate {
                folderViewer.Store.SetPixbuf(iter, pixbuf);
                folderViewer.ShowAll();
            });
        }