示例#1
0
        public void onNeighborUpdate(HaggleEvent he)
        {
            NeighborEvent e = he as NeighborEvent;
                        //Vibration.SoundFileInfo sfi = new Vibration.SoundFileInfo();
                        //sfi.sstType = Vibration.SoundType.Vibrate;
                        Debug.WriteLine("Neighbor update event!");

                        //uint ret = Vibration.SndSetSound(Vibration.SoundEvent.All, sfi, true);

                        Debug.WriteLine("neighbors received");

                        if ((DateTime.Now - vibrationTime).TotalSeconds > 5)
                        {
                                vib.vibrate(100, 50, 3);
                                vibrationTime = DateTime.Now;
                        }

                        neighborListWindow.BeginInvoke(new NeighborListUpdateDelegate(neighborListWindow.doNeighborListUpdate), e.neighbors);
        }
示例#2
0
 private void onInterestList(HaggleEvent he)
 {
     InterestsEvent e = he as InterestsEvent;
                 addInterestWindow.BeginInvoke(new InterestListUpdateDelegate(addInterestWindow.interestListUpdate), e.interests);
 }
示例#3
0
        // This function will run in the thread called from libhaggle
        private void onNewDataObject(HaggleEvent he)
        {
            DataObjectEvent e = he as DataObjectEvent;
                        Debug.WriteLine("New Data Object -- metadata:\n" + e.dObj.GetRaw());

                        try
                        {
                                // Verify that the attributes that PhotoShare expects exist
                                e.dObj.GetAttribute("Picture");

                                if (e.dObj.GetFilePath().Length > 0)
                                {
                                        dataObjects.Add(e.dObj);
                                        numDataObjects++;

                                        if ((DateTime.Now - vibrationTime).TotalSeconds > 5)
                                        {
                                                vib.vibrate(300, 100, 2);
                                                vibrationTime = DateTime.Now;
                                        }
                                        mainWindow.photoListView.BeginInvoke(new PhotoListUpdateDelegate(mainWindow.doPhotoListUpdate), e.dObj);
                                }
                        }
                        catch (Haggle.DataObject.NoSuchAttributeException)
                        {
                                Debug.WriteLine("No Picture attribute in received data object");
                        }
        }
示例#4
0
 private void onHaggleShutdown(HaggleEvent e)
 {
     MessageBox.Show("Haggle daemon was shut down");
 }