Beispiel #1
0
 private void OnControlFocusChanged(Control <TGlyph, TColor, TInput> control, PropertyChangedExtendedEventArgs <bool> e)
 {
     if (e.NewValue)
     {
         Focused = control;
     }
 }
Beispiel #2
0
 protected override void FocusChanged(PropertyChangedExtendedEventArgs <bool> args)
 {
     if (args.NewValue)
     {
         _selectedItemIndex = 0;
     }
 }
Beispiel #3
0
 private void Configuration_CurrentTypeChanged(object sender, PropertyChangedExtendedEventArgs <Type> e)
 {
     if (e.NewValue == typeof(PointVisualObject))
     {
         m_current.SetValue(CreatePoint());
     }
 }
Beispiel #4
0
 protected virtual void FocusChanged(PropertyChangedExtendedEventArgs <bool> args)
 {
     if (args.NewValue && Collection != null)
     {
         foreach (var control in Collection.Where(c => c != this))
         {
             control.IsFocused = false;
         }
     }
 }
Beispiel #5
0
 // ADD MUTEX !!!!!!!!!!!!!!!!!
 // Server - processing sent data and user input
 // Client - sending data to server
 private void ItemChanged(object sender, PropertyChangedExtendedEventArgs e)
 {
     if (sender is Entry entry)
     {
         client.ItemChanged(entry, e);
     }
     else
     {
         throw new NotImplementedException("Sender is not Entry!");
     }
 }
Beispiel #6
0
        public void BindAndInvokeInvokes()
        {
            var c1 = new NotifyingClass()
            {
                Foo = "FooVal",
            };
            PropertyChangedExtendedEventArgs <string> ea = null;

            c1.BindAndInvoke(s => s.Foo, (o, e) => ea = e);

            Assert.NotNull(ea);
            Assert.AreEqual("Foo", ea.PropertyName);
            Assert.AreEqual("FooVal", ea.NewValue);
        }
Beispiel #7
0
 protected override void FocusChanged(PropertyChangedExtendedEventArgs <bool> args)
 {
     base.FocusChanged(args);
     if (args.NewValue && Controls.Any())
     {
         Controls.First().IsFocused = true;
     }
     else if (!args.NewValue)
     {
         foreach (var control in Controls)
         {
             control.IsFocused = false;
         }
     }
 }
Beispiel #8
0
        public void ItemChanged(Entry entry, PropertyChangedExtendedEventArgs e)
        {
            IFormatter        formatter = new BinaryFormatter();
            CollectionMessage change    = new CollectionMessage
            {
                action       = "cha",
                entry        = entry,
                newValue     = e.NewValue,
                oldValue     = e.OldValue,
                propertyName = e.PropertyName
            };

            sendQueue.Enqueue(change);
            formatter.Serialize(stream, change);
        }
Beispiel #9
0
 private void KeyFramesEditor_ObjectChanged(object sender, PropertyChangedExtendedEventArgs <object> e)
 {
     if (!m_setting && m_keyFrames is IAbsoluteKeyFrameCollection keyFrames && e.OldValue is IAbsoluteKeyFrame oldValue)
     {
         if (e.NewValue is IAbsoluteKeyFrame newValue)
         {
             newValue.FramesCount = oldValue.FramesCount;
             newValue.Value       = oldValue.Value;
             keyFrames[keyFrames.IndexOf(oldValue)] = newValue;
         }
         else
         {
             keyFrames[keyFrames.IndexOf(oldValue)] = null;
         }
     }
 }
        private void Core_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            Engine es = (Engine)sender;

            // Relays the event if it contains important information about the
            // engine's state.
            if (e.PropertyName == "GameState")
            {
                PropertyChangedExtendedEventArgs <EngineGameState> eExtended = (PropertyChangedExtendedEventArgs <EngineGameState>)e;

                OnCoreGameStateChanged(eExtended.OldValue, eExtended.NewValue);
            }

            // Discards if the engine is not ready.
            if (!es.IsReady)
            {
                return;
            }

            // Relays the event.
            OnCorePropertyChanged(e.PropertyName);
        }
Beispiel #11
0
        private void Files_ItemChangedEvent(object sender, PropertyChangedExtendedEventArgs <object> e)
        {
            if (sender is Fichier fichier && fichier.Selected)
            {
                switch (e.PropertyName)
                {
                case "Format":
                {
                    UnRegisterInfo(0, e.OldValue);
                    RegisterInfo(0, e.NewValue);
                    DisplayInfo(MediaInfos.Format);
                    break;
                }

                case "Encoding":
                {
                    UnRegisterInfo(1, e.OldValue);
                    RegisterInfo(1, e.NewValue);
                    DisplayInfo(MediaInfos.Encoding);
                    break;
                }

                case "Channels":
                {
                    UnRegisterInfo(2, e.OldValue);
                    RegisterInfo(2, e.NewValue);
                    DisplayInfo(MediaInfos.Channels);
                    break;
                }

                case "SampleRateString":
                {
                    UnRegisterInfo(3, e.OldValue);
                    RegisterInfo(3, e.NewValue);
                    DisplayInfo(MediaInfos.SampleRate);
                    break;
                }

                case "TotalSamplesString":
                {
                    UnRegisterInfo(4, e.OldValue);
                    RegisterInfo(4, e.NewValue);
                    DisplayInfo(MediaInfos.TotalSamples);
                    break;
                }

                case "LoopFlagString":
                {
                    UnRegisterInfo(5, e.OldValue);
                    RegisterInfo(5, e.NewValue);
                    DisplayInfo(MediaInfos.LoopFlag);
                    break;
                }

                case "LoopStartString":
                {
                    UnRegisterInfo(6, e.OldValue);
                    RegisterInfo(6, e.NewValue);
                    DisplayInfo(MediaInfos.LoopStartString);
                    break;
                }

                case "LoopEndString":
                {
                    UnRegisterInfo(7, e.OldValue);
                    RegisterInfo(7, e.NewValue);
                    DisplayInfo(MediaInfos.LoopEndString);
                    break;
                }

                case "LoopCount":
                {
                    UnRegisterInfo(8, e.OldValue);
                    RegisterInfo(8, e.NewValue);
                    DisplayInfo(MediaInfos.LoopCount);
                    break;
                }

                case "StartEndLoop":
                {
                    UnRegisterInfo(9, e.OldValue);
                    RegisterInfo(9, e.NewValue);
                    DisplayInfo(MediaInfos.StartEndLoop);
                    break;
                }

                case "FadeDelay":
                {
                    UnRegisterInfo(10, e.OldValue);
                    RegisterInfo(10, e.NewValue);
                    DisplayInfo(MediaInfos.FadeDelay);
                    break;
                }

                case "FadeTime":
                {
                    UnRegisterInfo(11, e.OldValue);
                    RegisterInfo(11, e.NewValue);
                    DisplayInfo(MediaInfos.FadeTime);
                    break;
                }

                case "Destination":
                {
                    UnRegisterInfo(12, e.OldValue);
                    RegisterInfo(12, e.NewValue);
                    DisplayInfo(MediaInfos.Destination);
                    break;
                }

                case "FadeOut":
                {
                    UnRegisterInfo(13, e.OldValue);
                    RegisterInfo(13, e.NewValue);
                    DisplayInfo(MediaInfos.FadeOut);
                    break;
                }

                case "Layout":
                {
                    UnRegisterInfo(14, e.OldValue);
                    RegisterInfo(14, e.NewValue);
                    DisplayInfo(MediaInfos.Layout);
                    break;
                }

                case "InterleaveString":
                {
                    UnRegisterInfo(15, e.OldValue);
                    RegisterInfo(15, e.NewValue);
                    DisplayInfo(MediaInfos.Interleave);
                    break;
                }

                case "BitrateString":
                {
                    UnRegisterInfo(16, e.OldValue);
                    RegisterInfo(16, e.NewValue);
                    DisplayInfo(MediaInfos.Bitrate);
                    break;
                }

                case "SamplesToPlayString":
                {
                    UnRegisterInfo(17, e.OldValue);
                    RegisterInfo(17, e.NewValue);
                    DisplayInfo(MediaInfos.SamplesToPlay);
                    break;
                }
                }
            }
        }
Beispiel #12
0
 private void OnGeneralTimeChanged(object sender, PropertyChangedExtendedEventArgs <long> e) => UpdateCursorPoint(e.NewValue);
        public void ConnectionHandler(object sender, PropertyChangedExtendedEventArgs<int> args)
        {
            Dispatcher.Invoke(new Action(() =>
            {
                if (args.PropertyName == "connected")
                {
                    switch (((Server)sender).Status)
                    {
                        case 0: ((Server)sender).WinStatus = "Disconnected"; break;
                        case 1: if (((Server)sender).Side == 0)
                                ((Server)sender).WinStatus = "Connected as LeftServer";

                            else if (((Server)sender).Side == 1)
                                ((Server)sender).WinStatus = "Connected as RightServer";
                            break;
                        case 2: ((Server)sender).WinStatus = "Connecting..."; break;
                    }

                    if (cw != null && cw.IsVisible)
                    {
                        if (ch.LeftServer != null)
                        {
                            if (ch.LeftServer.Status == 1 || ch.LeftServer.Status == 2)
                                cw.leftbuttonmonitor.IsEnabled = false;
                            else if (ch.LeftServer.Status == 0)
                                cw.leftbuttonmonitor.IsEnabled = true;
                        }

                        if (ch.RightServer != null)
                        {
                            if ((ch.RightServer.Status == 1 || ch.RightServer.Status == 2))
                                cw.rightbuttonmonitor.IsEnabled = false;
                            else if (ch.RightServer.Status == 0)
                                cw.rightbuttonmonitor.IsEnabled = true;
                        }

                    }

                    if (((Server)(sender)).Status == 0)
                    {
                        stopCapturing();
                        if (((Server)(sender)).Side == 0)
                            ch.LeftServer = null;
                        else if (((Server)(sender)).Side == 1)
                            ch.RightServer = null;
                    }

                    if (pcRemote.SelectedItem != null && (((Server)(pcRemote.SelectedItem)).Status == 1))
                    {
                        buttonconnect.IsEnabled = true;
                        textconnect.Text = "Disconnect";
                        textconnect.Foreground = new SolidColorBrush(Colors.White);
                    }
                    else if (pcRemote.SelectedItem != null && (((Server)(pcRemote.SelectedItem)).Status == 2))
                    {
                        textconnect.Text = "Connecting";
                        textconnect.Foreground = new SolidColorBrush(Colors.Black);
                        buttonconnect.IsEnabled = false;

                    }
                    else if (pcRemote.SelectedItem != null && (((Server)(pcRemote.SelectedItem)).Status == 0))
                    {
                        buttonconnect.IsEnabled = true;
                        textconnect.Text = "Connect";
                        textconnect.Foreground = new SolidColorBrush(Colors.White);
                    }
                }
                ICollectionView view = CollectionViewSource.GetDefaultView(items);
                view.Refresh();
            }));
        }
 private void OnImportModeChanged(object x, PropertyChangedExtendedEventArgs <ImportMode> y)
 {
     this.UpdateImportModeOnViewModels();
 }