示例#1
1
		public void Subscribe_ShouldCallOnNextWhenSettingProperty(
			string value,
			Mock<IObserver<string>> observer,
			ISchedulers schedulers
			)
		{
			//arrange
			var sut = new ObservableProperty<string>(schedulers);
			sut.Subscribe(observer.Object);

			//act
			sut.Value = value;

			//assert
			observer.Verify(o => o.OnNext(value));
		}
示例#2
0
		public void TestValueProperty(
			WritablePropertyAssertion assertion,
			ISchedulers schedulers)
		{
			var sut = new ObservableProperty<string>(schedulers);
			assertion.VerifyProperty(() => sut.Value);
		}
示例#3
0
        public void when_initialValue_is_passed_to_the_constructor_then_Value_has_that_value()
        {
            var expected = Guid.NewGuid().ToString();

            var observableProperty = new ObservableProperty<string>(expected);

            Assert.That(observableProperty.Value, Is.EqualTo(expected));
        }
示例#4
0
 public BodyFromTexture(ObservableProperty<Texture2D> textureData, BodyType type = 0, float density = 1f)
     : base(Physic.World)
 {
     _textureData = textureData;
     _density = density;
     BodyType = type;
     Centroid = this.AttachPolyFromTexture(textureData.Value, density);
     textureData.Changed += Reload;
 }
示例#5
0
        public CalculatorPageViewModel(CalculatorsAndStopwatchApplicationViewModel applicationViewModel)
        {
            _applicationViewModel = applicationViewModel;
            _navigationViewModel = new NavigationViewModel(_applicationViewModel);

            _isCalculator2 = new ObservableProperty<bool>();
            _calculatorViewModel = new ObservableProperty<CalculatorViewModel>(_calculatorViewModel1);
            _calculatorText = CalculatedProperty<string>.Create(_isCalculator2, isCalculator2 => "Calculator " + (isCalculator2.Value ? "2" : "1"));
        }
        public ShellViewModel()
        {
            _semanticLoggingServiceInstalled = new ObservableProperty<bool>(false, this, () => SemanticLoggingServiceInstalled);
            _installSemanticLoggingService = new ObservableCommand();

            _behaviors = new CompositeDisposable(
                InstallSemanticLoggingServiceCommandShouldBeEnabledWhenSemanticLoggingServiceIsNotInstalled(),
                SemanticLoggingServiceShouldBeInstalledWhenInstallSemanticLoggingServiceCommandExecuted()
            );
        }
示例#7
0
		public void OnNext_ShouldSetValue(
			string value,
			ISchedulers schedulers)
		{
			var sut = new ObservableProperty<string>(schedulers);

			//act
			sut.OnNext(value);

			//assert
			sut.Value.Should().Be(value);
		}
示例#8
0
		public void OnError_ShouldSetError(
			Exception value,
			ISchedulers schedulers)
		{
			var sut = new ObservableProperty<string>(schedulers);

			//act
			sut.OnError(value);

			//assert
			sut.Error.Should().Be(value);
		}
示例#9
0
        public void when_Value_is_set_then_ValueChanged_pumps()
        {
            var expected = Guid.NewGuid().ToString();

            var result = string.Empty;

            var observableProperty = new ObservableProperty<string>();
            observableProperty.ValueChanged
                              .Subscribe(x => result = x);

            observableProperty.Value = expected;

            Assert.That(result, Is.EqualTo(expected));
        }
示例#10
0
 public StopwatchViewModel()
 {
     _viewModes = new ObservableCollection<ViewMode>(new[] { ViewMode.Milliseconds, ViewMode.Seconds });
     _selectedViewMode = new ObservableProperty<ViewMode?>(ViewMode.Seconds);
     _isActive = new ObservableProperty<bool>(true);
     _isActive.Changed += (sender, args) => UpdateTimerState();
     _elapsed = new ObservableProperty<TimeSpan>();
     _elapsedString = CalculatedProperty<string>.Create(_elapsed, _selectedViewMode, (elapsed, selectedViewMode) => GetTimeSpanString(elapsed.Value, selectedViewMode.Value));
     _isRunning = new ObservableProperty<bool>();
     _isRunning.Changed += (sender, args) => UpdateTimerState();
     _allowStop = CalculatedProperty<bool>.Create(_isRunning, isRunning => isRunning.Value);
     _allowStart = CalculatedProperty<bool>.Create(_isRunning, isRunning => !isRunning.Value);
     _timer = TimerFactory.Instance.CreateTimer(OnTimerElapsed, 27, true);
 }
示例#11
0
        public CardModel(string key, PlayerModel owner, CardItem data, bool isPawn)
            : base(owner, key)
        {
            Data = data;
              IsPawn = isPawn;
              Position = new ObservableProperty<CardPosition, CardModel>(this, new CardPosition(0, 0));
              Visibility = new ObservableProperty<CardVisibility, CardModel>(this, CardVisibility.Visible);
              Reversed = new ObservableProperty<bool, CardModel>(this, false);
              Locked = new ObservableProperty<bool, CardModel>(this, false);
              Rotated = new ObservableProperty<bool, CardModel>(this, false);
              CustomCharacteristics = new ObservableProperty<string, CardModel>(this, string.Empty);
              Tokens = new ModelCollection(this);

              SaveState();

              this.Visibility.Changed += new EventHandler<ChangedEventArgs<CardVisibility>>(Visibility_Changed);
        }
示例#12
0
        public Channel(IClientConnection connection, String name, SynchronizationContext context)
        {
            _context = context;
            _users = new SynchronizedKeyedCollection<String, IChannelUser>(_context);
            _knownUsers = new SynchronizedKeyedCollection<String, IChannelUser>(_context);

            Connection = connection;
            Name = new ObservableProperty<String>(name);
            Modes = new Mode();
            Topic = new ObservableProperty<String>(String.Empty);
            TopicSetBy = new ObservableProperty<IUser>(null);
            TopicSetDate = new ObservableProperty<uint>(0);
            CreatedDate = new ObservableProperty<uint>(0);

            ReceivedMessages = connection.ReceivedMessages
                .Where(m => m.Receiver.Equals(this))
                ;
        }
        public LogInPageViewModel(IAuthenticationService authenticationService)
        {
            _authenticationService = authenticationService;

            _username = new ObservableProperty<string>(this, () => Username);
            _password = new ObservableProperty<string>(this, () => Password);
            _error = new ObservableProperty<string>(this, () => Error);
            _logInCommand = new ObservableCommand();
            _cancelCommand = new ObservableCommand();

            _logInResponse = new Subject<AuthenticationResponse>();

            _behaviors = new CompositeDisposable(
                WhenTheUserHasEnteredBothUsernameAndPasswordThenEnableLogInButton(),
                WhenTheUserClicksTheLogInButtonAttemptToLogIn(),
                WhenASuccessfulLogInAttemptIsMadeCloseTheDialog(),
                WhenAnUnsuccessfulLogInAttemptIsMadeDisplayTheError(),
                WhenTheUserClicksTheCancelButtonCloseTheDialog()
            );
        }
示例#14
0
        public MainViewModel(AltitudeAngelService altitudeAngelService)
        {
            _altitudeAngelService = altitudeAngelService;
            SignInCommand = new DelegateCommandAsync<object>(ExecuteConnect, true);
            DisconnectCommand = new DelegateCommandAsync<object>(ExecuteDisconnect, true);
            SignInState = new ObservableProperty<SignInStates>(SignInStates.NotSignedIn);
            PermitStatus = new ObservableProperty<PermitStates>(PermitStates.NoPermit);
            TelemetryPulse = new ObservableProperty<bool>();


            _altitudeAngelService.IsSignedIn
                                 .Subscribe(UpdateSignInState);

            _altitudeAngelService.WeatherReport
                                 .ObserveOnDispatcher()
                                 .Subscribe(WeatherChanged);

            _altitudeAngelService.SentTelemetry
                                 .Subscribe(i => NewTelemetry());
        }
示例#15
0
文件: User.cs 项目: Gohla/ReactiveIRC
        public User(IClientConnection connection, String name, SynchronizationContext context)
        {
            _context = context;
            _channels = new SynchronizedKeyedCollection<String, IChannel>(_context);
            _knownChannels = new SynchronizedKeyedCollection<String, IChannel>(_context);

            Connection = connection;
            Identity = new Identity(name, null, null);
            RealName = new ObservableProperty<String>(String.Empty);
            Network = new ObservableProperty<INetwork>(null);
            Modes = new Mode();
            Away = new ObservableProperty<bool>(false);
            Name = new ObservableProperty<String>(name);

            ReceivedMessages = connection.ReceivedMessages
                .Where(m => m.Receiver.Equals(this))
                ;
            SentMessages = connection.ReceivedMessages
                .Where(m => m.Sender.Equals(this))
                ;
        }
        public AltitudeAngelService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            FlightDataService flightDataService
            )
        {
            _messagesService = messagesService;
            _missionPlanner = missionPlanner;
            _flightDataService = flightDataService;
            IsSignedIn = new ObservableProperty<bool>(false);
            WeatherReport = new ObservableProperty<WeatherInfo>();
            SentTelemetry = new ObservableProperty<Unit>();

            CreateClient((url, apiUrl, state) =>
                new AltitudeAngelClient(url, apiUrl, state,
                    (authUrl, existingState) => new AltitudeAngelHttpHandlerFactory(authUrl, existingState)));

            _disposer.Add(_missionPlanner.FlightDataMap
                .MapChanged
                .Throttle(TimeSpan.FromSeconds(1))
                .Subscribe(i => UpdateMapData(_missionPlanner.FlightDataMap)));

            _disposer.Add(_missionPlanner.FlightPlanningMap
              .MapChanged
              .Throttle(TimeSpan.FromSeconds(1))
              .Subscribe(i => UpdateMapData(_missionPlanner.FlightPlanningMap)));

            try
            {
                var list = JsonConvert.DeserializeObject<List<string>>(_missionPlanner.LoadSetting("AAWings.Filters"));

                FilteredOut.AddRange(list.Distinct());
            } catch
            {

            }

            TryConnect();
        }
示例#17
0
        protected CalculatorViewModelBase(bool supportsAsync)
        {
            _updateInRealTimeItems = new ObservableCollection<bool>(new[] { true, false });
            _updateInRealTimeSelection = new ObservableProperty<bool?>(true);
            _updateInRealTime = CalculatedProperty<bool>.Create(_updateInRealTimeSelection, updateInRealTimeSelection => updateInRealTimeSelection.Value.HasValue && updateInRealTimeSelection.Value.Value);
            _supportsAsync = new ReadOnlyProperty<bool>(supportsAsync);
            _simulateLatencyItems = new ObservableCollection<bool>(new[] { true, false });
            _simulateLatencySelection = new ObservableProperty<bool?>(true);
            _simulateLatency = CalculatedProperty<bool>.Create(_simulateLatencySelection, simulateLatencySelection => simulateLatencySelection.Value.HasValue && simulateLatencySelection.Value.Value);
            _operators = new ObservableCollection<Operator>(new[] { Operator.Add, Operator.Subtract, Operator.Multiply, Operator.Divide });
            _operand1 = new ObservableProperty<string>();
            _selectedOperator = new ObservableProperty<Operator?>();
            _selectedOperator.Value = Operator.Add;
            _selectedOperatorString = CalculatedProperty<string>.Create(_selectedOperator, selectedOperator =>
                {
                    if (selectedOperator.Value == null)
                    {
                        return null;
                    }

                    switch (selectedOperator.Value.Value)
                    {
                        case Operator.Add:
                            return "+";
                        case Operator.Subtract:
                            return "-";
                        case Operator.Multiply:
                            return "*";
                        case Operator.Divide:
                            return "/";
                        default:
                            throw new NotSupportedException("Unknown enum value " + selectedOperator.Value.Value + ".");
                    }
                });
            _operand2 = new ObservableProperty<string>();
        }
        public AltitudeAngelService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            FlightDataService flightDataService
            )
        {
            _messagesService = messagesService;
            _missionPlanner = missionPlanner;
            _flightDataService = flightDataService;
            IsSignedIn = new ObservableProperty<bool>(false);
            WeatherReport = new ObservableProperty<WeatherInfo>();
            SentTelemetry = new ObservableProperty<Unit>();

            CreateClient((url, apiUrl, state) =>
                new AltitudeAngelClient(url, apiUrl, state,
                    (authUrl, existingState) => new AltitudeAngelHttpHandlerFactory(authUrl, existingState)));

            _disposer.Add(_missionPlanner.FlightDataMap
                .MapChanged
                .Throttle(TimeSpan.FromSeconds(1))
                .Subscribe(i => UpdateMapData(_missionPlanner.FlightDataMap)));

            TryConnect();
        }
示例#19
0
文件: Mode.cs 项目: Gohla/ReactiveIRC
        public void Dispose()
        {
            if(Modes == null)
                return;

            Modes.Clear();
            Modes.Dispose();
            Modes = null;
            ModesString.Dispose();
            ModesString = null;
        }
示例#20
0
 internal void BindTo(ObservableProperty property)
 {
     bindTarget            = property;
     bindTarget.OnChanged += BindTarget_OnChanged;
     BindTarget_OnChanged(property, null);
 }
示例#21
0
        public AppModel()
        {
            SwitchDevice  = ObservableProperty.CreateSettable <object>(null, true);
            ReverseBitmap = ObservableProperty.CreateSettable <object>(null, true);

            VideoBitmap = ObservableProperty.CreateSettable <BitmapFrame>(null);
            IsRunning   = ObservableProperty.CreateSettable(false);

            var oldNewIndexes = SwitchDevice
                                .Select(_ => new
            {
                OldValue = SelectedDeviceIndex.Value,
                NewValue = (SelectedDeviceIndex.Value + 1) % _devices.Length
            })
                                .ToGetOnly(null);

            SelectedDeviceIndex = oldNewIndexes
                                  .Select(_ => _.NewValue)
                                  .ToGetOnly(0);

            BitmapScaleX = ReverseBitmap
                           .Select(_ => - 1 * BitmapScaleX.Value)
                           .ToGetOnly(-1);

            _devices = new FilterInfoCollection(FilterCategory.VideoInputDevice)
                       .Cast <FilterInfo>()
                       .Select(f => new VideoCaptureDevice(f.MonikerString))
                       .Do(d => d.VideoResolution = GetResolution(d.VideoCapabilities))
                       .ToArray();
            if (_devices.Length == 0)
            {
                return;
            }

            IsRunning
            //.Throttle(TimeSpan.FromMilliseconds(200))
            .ObserveOn(Scheduler.Default)
            .Subscribe(b =>
            {
                if (b)
                {
                    StartDevice(SelectedDeviceIndex.Value);
                }
                else
                {
                    StopDevice(SelectedDeviceIndex.Value);
                }
            });

            oldNewIndexes
            .Where(_ => IsRunning.Value)
            //.Throttle(TimeSpan.FromMilliseconds(200))
            .ObserveOn(Scheduler.Default)
            .Subscribe(_ =>
            {
                StopDevice(_.OldValue);
                // 連続してデバイスを操作すると失敗することがあるため、待機します。
                Thread.Sleep(200);
                StartDevice(_.NewValue);
            });
        }
示例#22
0
 public MessagesService()
 {
     Messages = new ObservableProperty<Message>(0);
 }
示例#23
0
        public void Dispose()
        {
            if(Host == null)
                return;

            Host.Dispose();
            Host = null;
            Ident.Dispose();
            Ident = null;
            Name.Dispose();
            Name = null;
        }
示例#24
0
 public MoveComponent(Vector2 position, float angle, float speed)
 {
     Speed    = speed;
     Position = new ObservableProperty <Vector2>(position);
     Angle    = new ObservableProperty <float>(angle);
 }
示例#25
0
        public AppModel()
        {
            var kinect = new AsyncKinectManager();

            ColorBitmap = kinect.Sensor
                          .ObserveOn(SynchronizationContext.Current)
                          .Select(sensor => sensor != null ? ColorBitmapInfo.CreateBitmap() : null)
                          .ToGetOnly(null);
            kinect.SensorConnected
            .Subscribe(sensor =>
            {
                sensor.ColorStream.Enable(ColorBitmapInfo.Format);
                sensor.DepthStream.Enable(DepthBitmapInfo.Format);

                try
                {
                    sensor.Start();
                }
                catch (Exception ex)
                {
                    // センサーが他のプロセスに既に使用されている場合に発生します。
                    Debug.WriteLine(ex);
                }
            });
            kinect.SensorDisconnected
            .Subscribe(sensor => sensor.Stop());
            kinect.Initialize();

            var frameData = Observable.Interval(FramesInterval)
                            .Select(_ => new
            {
                Sensor    = kinect.Sensor.Value,
                ColorData = kinect.Sensor.Value.GetColorData(FramesInterval),
                DepthData = kinect.Sensor.Value.GetDepthData(FramesInterval),
            })
                            .ToGetOnly(null);

            frameData
            .Where(_ => _.ColorData != null)
            .ObserveOn(SynchronizationContext.Current)
            .Subscribe(_ => ColorBitmapInfo.WritePixels(ColorBitmap.Value, _.ColorData));

            var colorDepthMap = frameData
                                .Where(_ => _.DepthData != null)
                                .Select(_ =>
            {
                var map = new DepthImagePoint[ColorBitmapInfo.PixelsCount];
                _.Sensor.CoordinateMapper.MapColorFrameToDepthFrame(ColorBitmapInfo.Format, DepthBitmapInfo.Format, _.DepthData, map);
                return(map);
            })
                                .ToGetOnly(new DepthImagePoint[ColorBitmapInfo.PixelsCount]);

            SelectedPosition = ObservableProperty.CreateSettable(new Point(ColorBitmapInfo.Width / 2, ColorBitmapInfo.Height / 2));

            SelectedDepth = ObservableProperty.CreateGetOnly(() =>
            {
                var depth = colorDepthMap.Value[PositionToPixelIndex(SelectedPosition.Value)].Depth;
                return(depth > 0 ? depth : default(int?));
            });
            colorDepthMap.Subscribe(SelectedDepth);
            SelectedPosition.Subscribe(SelectedDepth);
        }
        public AltitudeAngelService(
            IMessagesService messagesService,
            IMissionPlanner missionPlanner,
            ISettings settings,
            IFlightDataService flightDataService,
            IAltitudeAngelClient client)
        {
            _messagesService = messagesService;
            _missionPlanner  = missionPlanner;
            _settings        = settings;
            _client          = client;

            IsSignedIn = new ObservableProperty <bool>(false);
            _disposer.Add(IsSignedIn);
            WeatherReport = new ObservableProperty <WeatherInfo>();
            _disposer.Add(WeatherReport);
            SentTelemetry = new ObservableProperty <Unit>();
            _disposer.Add(SentTelemetry);

            try
            {
                _disposer.Add(_missionPlanner.FlightDataMap
                              .MapChanged
                              .Throttle(TimeSpan.FromSeconds(10))
                              .RepeatLastValue(TimeSpan.FromSeconds(60))
                              .Subscribe(i => UpdateMapData(_missionPlanner.FlightDataMap)));
            }
            catch
            {
            }

            try
            {
                _disposer.Add(_missionPlanner.FlightPlanningMap
                              .MapChanged
                              .Throttle(TimeSpan.FromSeconds(1))
                              .RepeatLastValue(TimeSpan.FromSeconds(60))
                              .Subscribe(i => UpdateMapData(_missionPlanner.FlightPlanningMap)));
            }
            catch
            {
            }

            try
            {
                _disposer.Add(flightDataService.FlightArmed
                              .Subscribe(i => SubmitFlightReport(i)));
                _disposer.Add(flightDataService.FlightDisarmed
                              .Subscribe(i => CompleteFlightReport(i)));
            }
            catch
            {
            }

            try
            {
                FilteredOut = _settings.MapFilters;
            }
            catch
            {
            }
        }
示例#27
0
 public ObservablePropertySpec_Binding_MultiBinding()
 {
     Property = ObservableProperty <string> .Of("Test1");
 }
示例#28
0
 public MessagesService()
 {
     Messages = new ObservableProperty <Message>(0);
 }
        public void ObservableStringInConstructor(string input)
        {
            var observableString = new ObservableProperty <string>(input);

            Assert.AreEqual(input, observableString.Value);
        }
        public void ObservableNullConstructor()
        {
            var observableString = new ObservableProperty <string>(null);

            Assert.IsNull(observableString.Value);
        }
        private void TimeStringChanged(ObservableProperty prop, ModelBase model, object value)
        {
            var val = value as string;

            if(string.IsNullOrWhiteSpace(val)) return;

            try
            {
                var time = TimeSpan.Parse(val, CultureInfo.CurrentUICulture);
                if(time.Ticks < 0) return;

                _targetTime = DateTime.Now + time;
                UpdateTimer();
            }
            catch (Exception e) when(e is OverflowException || e is BadImageFormatException || e is ArgumentException)
            {
            }
        }
示例#32
0
 public void Setup()
 {
     _prop = new ObservableProperty<MockQueueable>();
 }
示例#33
0
 public Network(IClientConnection connection, String name)
 {
     Connection = connection;
     Name = new ObservableProperty<String>(name);
 }
示例#34
0
        protected virtual void AddValue(string key, object value)
        {
            IObservableProperty property;

            if (!data.TryGetValue(key, out property))
            {
                Type valueType = value != null?value.GetType() : typeof(object);

#if NETFX_CORE
                TypeCode typeCode = WinRTLegacy.TypeExtensions.GetTypeCode(valueType);
#else
                TypeCode typeCode = Type.GetTypeCode(valueType);
#endif
                switch (typeCode)
                {
                case TypeCode.Boolean:
                {
                    property = new ObservableProperty <bool>();
                    break;
                }

                case TypeCode.Byte:
                {
                    property = new ObservableProperty <byte>();
                    break;
                }

                case TypeCode.Char:
                {
                    property = new ObservableProperty <char>();
                    break;
                }

                case TypeCode.DateTime:
                {
                    property = new ObservableProperty <DateTime>();
                    break;
                }

                case TypeCode.Decimal:
                {
                    property = new ObservableProperty <Decimal>();
                    break;
                }

                case TypeCode.Double:
                {
                    property = new ObservableProperty <Double>();
                    break;
                }

                case TypeCode.Int16:
                {
                    property = new ObservableProperty <short>();
                    break;
                }

                case TypeCode.Int32:
                {
                    property = new ObservableProperty <int>();
                    break;
                }

                case TypeCode.Int64:
                {
                    property = new ObservableProperty <long>();
                    break;
                }

                case TypeCode.SByte:
                {
                    property = new ObservableProperty <sbyte>();
                    break;
                }

                case TypeCode.Single:
                {
                    property = new ObservableProperty <float>();
                    break;
                }

                case TypeCode.String:
                {
                    property = new ObservableProperty <string>();
                    break;
                }

                case TypeCode.UInt16:
                {
                    property = new ObservableProperty <UInt16>();
                    break;
                }

                case TypeCode.UInt32:
                {
                    property = new ObservableProperty <UInt32>();
                    break;
                }

                case TypeCode.UInt64:
                {
                    property = new ObservableProperty <UInt64>();
                    break;
                }

                case TypeCode.Object:
                {
                    if (valueType.Equals(typeof(Vector2)))
                    {
                        property = new ObservableProperty <Vector2>();
                    }
                    else if (valueType.Equals(typeof(Vector3)))
                    {
                        property = new ObservableProperty <Vector3>();
                    }
                    else if (valueType.Equals(typeof(Vector4)))
                    {
                        property = new ObservableProperty <Vector4>();
                    }
                    else if (valueType.Equals(typeof(Color)))
                    {
                        property = new ObservableProperty <Color>();
                    }
                    else
                    {
                        property = new ObservableProperty();
                    }
                    break;
                }

                default:
                {
                    property = new ObservableProperty();
                    break;
                }
                }
                data[key] = property;
            }
            property.Value = value;
        }
示例#35
0
 public void Initialize() {
     Gold = new ObservableProperty<int>(150);
     BattleManager.Initialize();
     CooldownService.AddCooldown(1f, null, NextRound);
 }
示例#36
0
 set => SetValue(ObservableProperty, value);
示例#37
0
 public DeckRoomModel(ServicesProvider servicesProvider, GameInfoItem gameItem)
 {
     this.ServicesProvider = servicesProvider;
       this.GameItem = gameItem;
       this.SelectedDeck = new ObservableProperty<DeckItem, DeckRoomModel>(this, null);
 }
示例#38
0
 public Mode()
 {
     Modes       = new ObservableHashSet <char>();
     ModesString = new ObservableProperty <String>(String.Empty);
 }
示例#39
0
 public Identity(String name, String ident, String host)
 {
     Name = new ObservableProperty<String>(name);
     Ident = new ObservableProperty<String>(ident);
     Host = new ObservableProperty<String>(host);
 }
 public override string ToString()
 {
     return(ObservableProperty.ToString());
 }
示例#41
0
 public SomeClass()
 {
     SomeDouble = new ObservableProperty <double>();
 }
示例#42
0
文件: Mode.cs 项目: Gohla/ReactiveIRC
 public Mode()
 {
     Modes = new ObservableHashSet<char>();
     ModesString = new ObservableProperty<String>(String.Empty);
 }
示例#43
0
 /// <summary>
 /// Converts the specified value to the observable property.
 /// </summary>
 /// <typeparam name="T">The type of the property value.</typeparam>
 /// <param name="target">The object that is converted to the observable property.</param>
 /// <returns>The instance of the <see cref="ObservableProperty{T}"/> class.</returns>
 public static ObservableProperty <T> ToObservableProperty <T>(this T target) => ObservableProperty <T> .Of(target);
 public CardDisplayModel(string key)
     : base(key)
 {
     Cards = new List<CardItem>();
       Visible = new ObservableProperty<bool, CardDisplayModel>(this, false);
 }
 public ThemeEditorTreeViewItem(string themeId, string name, bool isActive)
 {
     ThemeId   = themeId;
     _isActive = new ObservableProperty <bool>(isActive);
     SetName(name, false);
 }
示例#46
-1
		public void Subscribe_WithDefaultValue_ShouldNotCallOnNext(
			string value,
			Mock<IObserver<string>> observer,
			ISchedulers schedulers)
		{
			//arrange
			var sut = new ObservableProperty<string>(schedulers);
			sut.Subscribe(observer.Object);

			//assert
			observer.Verify(o => o.OnNext(It.IsAny<string>()), Times.Never());
		}