예제 #1
0
        // ============================================
        // PRIVATE (Methods) Event Handlers
        // ============================================
        private void OnAdded(object sender)
        {
            Gtk.Application.Invoke(delegate {
                FileReceiver fileRecv = sender as FileReceiver;

                FileProgressObject obj = new FileProgressObject();
                obj.Delete            += new BlankEventHandler(OnButtonDelete);

                // Setup Image
                string ext = FileUtils.GetExtension(fileRecv.MyDiskName);
                obj.Image  = StockIcons.GetFileIconPixbuf(TextUtils.UpFirstChar(ext));

                // Set Transfer Info
                SetTransferInfo(obj, fileRecv);

                // Set Info
                UserInfo userInfo = fileRecv.Peer.Info as UserInfo;
                obj.SetName(fileRecv.Name, userInfo.Name);

                // Add Update
                progressObjects.Add(fileRecv, obj);
                vbox.PackStart(obj, false, false, 2);
                obj.ShowAll();
            });
        }