Example #1
0
 protected virtual void OnTrackerChanged(TrackerEventArgs e)
 {
     if (trackerChanged != null)
     {
         trackerChanged(this, e);
     }
 }
 /// <summary>Raises the <see cref="TrackingStopped"/> event.</summary>
 /// <param name="e">The data for the event.</param>
 protected virtual void OnTrackingStopped(TrackerEventArgs e)
 {
     if (this.TrackingStopped != null)
     {
         this.TrackingStopped(this, e);
     }
 }
Example #3
0
 private void Tracker_Ended(object sender, TrackerEventArgs e)
 {
     if (e.Tracker == Tracker)
     {
         _trackerStack.Pop();
     }
 }
Example #4
0
        void tracker_DeviceRemoved(object sender, TrackerEventArgs e)
        {
            if (!DialogExitActive)
            {
                DialogExitActive = true;

                ScatterViewItem control;
                if (sender.GetType().Name.Equals("MinimizedControl"))
                {
                    control = ((ScatterViewItem)e.Device.MinControl.Parent);
                }
                else
                {
                    control = ((ScatterViewItem)e.Device.Control.Parent);
                }
                control.ContactLeave += new ContactEventHandler(control_ContactLeave);

                DialogExitSvi             = new ScatterViewItem();
                DialogExitSvi.CanMove     = false;
                DialogExitSvi.CanRotate   = false;
                DialogExitSvi.CanScale    = false;
                DialogExitSvi.Orientation = 0;
                DialogExitSvi.Width       = 120;
                DialogExitSvi.Height      = 65;
                //DialogExitSvi.Center = new System.Windows.Point(200, 200);
                DialogExitSvi.Background  = System.Windows.Media.Brushes.Transparent;
                DialogExitSvi.BorderBrush = System.Windows.Media.Brushes.Transparent;
                DialogExitSvi.SetResourceReference(StyleProperty, "ScatterViewItemStyleInvisible");
                MainSV.Items.Add(DialogExitSvi);
                //DialogExitSvi.Visibility = Visibility.Hidden;

                Dialog dialog = new Dialog();
                DialogExitSvi.Content = dialog;
                dialog.Question       = "Exit application?";
                DialogExitSvi.Center  = new System.Windows.Point(control.Center.X, control.Center.Y);
                //DialogExitSvi.Visibility = Visibility.Visible;

                Storyboard story = DialogExitSvi.Center.X > 924 ? SetStoryTarget("showDialogLeft", DialogExitSvi) : SetStoryTarget("showDialog", DialogExitSvi);
                story.Begin(this);

                Action hideItem = delegate
                {
                    dialog.Freeze();
                    Storyboard endStory = SetStoryTarget("hideDialog", DialogExitSvi);
                    endStory.Completed += delegate { MainSV.Items.Remove(DialogExitSvi); DialogExitActive = false; };
                    endStory.Begin(this);
                };

                dialog.No += delegate { hideItem(); };

                dialog.Yes += delegate
                {
                    hideItem();
                    RemoveDevice(sender, e);
                };
            }
        }
Example #5
0
        void AddDevice(object sender, TrackerEventArgs e)
        {
            e.Device.Control.Connect();
            //e.Device.Control.Disconnected += new DeviceControl.DCEventHandler(Control_Disconnected);
            e.Device.Control.Disconnected += tracker_DeviceRemoved;
            e.Device.Control.Minimized    += Control_Minimized;

            AddSVI(e.Device.Control);
            AddSVI(e.Device.MinControl);
        }
Example #6
0
        void RemoveDevice(object sender, TrackerEventArgs e)
        {
            e.Device.Control.rdfWPF.Disconnect();

            if (sender.GetType().Name.Equals("MinimizedControl"))
            {
                MainSV.Items.Remove(((MinimizedControl)sender).Parent);
            }

            MainSV.Items.Remove(e.Device.Control.Parent);
            MainSV.UpdateLayout();
        }
Example #7
0
        protected void trackerEvent(object o, TrackerEventArgs e)
        {
            Dictionary <string, string> args = new Dictionary <string, string>();

            args.Add("avataruuid", e.avatarUUID.ToString());
            args.Add("avatarname", e.avatarName);
            if (e.Leaving == true)
            {
                TriggerEvent("GuestLeavesArea", args);
            }
            else
            {
                args.Add("AvatarSim", e.simName);
                args.Add("AvatarParcel", e.parcelName);
                TriggerEvent("GuestEntersArea", args);
            }
        }
Example #8
0
        void tracker_DeviceAdded(object sender, TrackerEventArgs e)
        {
            if (!DialogConnectActive)
            {
                DialogConnectActive = true;

                DialogConnectSvi             = new ScatterViewItem();
                DialogConnectSvi.CanMove     = false;
                DialogConnectSvi.CanRotate   = false;
                DialogConnectSvi.CanScale    = false;
                DialogConnectSvi.Orientation = 0;
                DialogConnectSvi.Width       = 120;
                DialogConnectSvi.Height      = 65;
                //DialogConnectSvi.Center = new System.Windows.Point(200, 200);
                DialogConnectSvi.Background  = System.Windows.Media.Brushes.Transparent;
                DialogConnectSvi.BorderBrush = System.Windows.Media.Brushes.Transparent;
                DialogConnectSvi.SetResourceReference(StyleProperty, "ScatterViewItemStyleInvisible");
                MainSV.Items.Add(DialogConnectSvi);
                //DialogConnectSvi.Visibility = Visibility.Hidden;

                Dialog dialog = new Dialog();
                DialogConnectSvi.Content = dialog;
                dialog.Question          = "Connect to device?";
                DialogConnectSvi.Center  = new System.Windows.Point(e.Device.Center().X, e.Device.Center().Y);
                //  DialogConnectSvi.Visibility = Visibility.Visible;

                Storyboard story = DialogConnectSvi.Center.X > 824 ? SetStoryTarget("showDialogLeft", DialogConnectSvi) : SetStoryTarget("showDialog", DialogConnectSvi);
                story.Begin(this);

                Action hideItem = delegate
                {
                    dialog.Freeze();
                    Storyboard endStory = SetStoryTarget("hideDialog", DialogConnectSvi);
                    endStory.Completed += delegate { MainSV.Items.Remove(DialogConnectSvi); DialogConnectActive = false; };
                    endStory.Begin(this);
                };

                dialog.No += delegate { hideItem(); };

                dialog.Yes += delegate
                {
                    hideItem();
                    AddDevice(sender, e);
                };
            }
        }
        /// <summary>
        /// Stops tracking (don't destroy/hide tracked popup), do nothing if nothing is tracked currently.
        /// Fire <seealso cref="TrackingStopped"/> event.
        /// </summary>
        public virtual void Stop()
        {
            if (!this.Tracking)
            {
                return;
            }

            if (this._timerTrackHoverout != null)
            {
                this._timerTrackHoverout.Stop();
            }

            var e = new TrackerEventArgs(this._wnd, this._control);

            // have to clear internal state BEFORE firing event, because event handler can and will reuse this instance of tracker
            this._control = null;
            this._wnd     = null;
            this.OnTrackingStopped(e);

            // don't touch internal state AFTER event firing, because event handler might alter it already!
        }
Example #10
0
        public void AddPairTest()
        {
            var tracker = new YamlNodeTracker();
            var stream  = new YamlStream(tracker);

            stream.Add(new YamlDocument());
            stream[0].Contents = new YamlMapping();

            TrackerEventArgs receivedArgs = null;

            tracker.TrackerEvent += (sender, args) => {
                receivedArgs = args;
            };

            ((YamlMapping)stream[0].Contents)["A"] = new YamlValue(5);

            Assert.IsTrue(receivedArgs is MappingPairAdded);
            Assert.AreEqual(TrackerEventType.MappingPairAdded, ((MappingPairAdded)receivedArgs).EventType);
            Assert.AreEqual(0, ((MappingPairAdded)receivedArgs).Index);
            Assert.AreEqual(new Model.Path(stream, new [] { new ChildIndex(0, false), new ChildIndex(-1, false) }), ((MappingPairAdded)receivedArgs).ParentPaths[0]);
            Assert.AreEqual("A", ((MappingPairAdded)receivedArgs).Child.Key.ToString());
            Assert.AreEqual("5", ((MappingPairAdded)receivedArgs).Child.Value.ToString());
        }
Example #11
0
 public void C(TrackerEventArgs args)
 {
     CCalls++;
 }
Example #12
0
 public void B(TrackerEventArgs args)
 {
     BCalls++;
 }
Example #13
0
 public void A(TrackerEventArgs args)
 {
     ACalls++;
 }
Example #14
0
 private void HandleTrackerChanged(object sender, TrackerEventArgs e)
 {
     _isTrackerOpen = e.HitResult != null;
 }
Example #15
0
 void tracker_DeviceUpdated(object sender, TrackerEventArgs e)
 {
     //Status.Content = "Device Updated!";
     //DisplayExtension.Center = new System.Windows.Point(e.Device.Center().X, e.Device.Center().Y);
     //DisplayExtension.Orientation = e.Device.Orientation();
 }
Example #16
0
 private void Tracker_Began(object sender, TrackerEventArgs e)
 {
     _trackerStack.Push(e.Tracker);
 }