示例#1
0
 private SelectStateViewModel(IDataService service, Country country, State state, Action<State> select,
                              Action cancel)
 {
     _service = service;
     _initialCountry = country;
     _initialState = state;
     _select = select;
     _cancel = cancel;
 }
示例#2
0
 private SelectSuburbViewModel(IDataService service, Country country, State state, Suburb suburb,
                               Action<Suburb> select, Action cancel)
 {
     _service = service;
     _initialCountry = country;
     _initialState = state;
     _initialSuburb = suburb;
     _select = select;
     _cancel = cancel;
 }
示例#3
0
     private void FixupState(State previousValue, bool skipKeys = false)
     {
         if (IsDeserializing)
         {
             return;
         }
 
         if (State != null)
         {
             StateId = State.Id;
         }
 
         else if (!skipKeys)
         {
             StateId = null;
         }
 
         if (ChangeTracker.ChangeTrackingEnabled)
         {
             if (ChangeTracker.OriginalValues.ContainsKey("State")
                 && (ChangeTracker.OriginalValues["State"] == State))
             {
                 ChangeTracker.OriginalValues.Remove("State");
             }
             else
             {
                 ChangeTracker.RecordOriginalValue("State", previousValue);
             }
             if (State != null && !State.ChangeTracker.ChangeTrackingEnabled)
             {
                 State.StartTracking();
             }
         }
     }
示例#4
0
 // Shared static public methods
 public static void Ask(IDataService service, Country country, State state, Suburb suburb,
                        Action<Suburb> select, Action cancel)
 {
     (new SelectSuburbViewModel(service, country, state, suburb, select, cancel)).Ask();
 }
示例#5
0
 static SettingViewModel()
 {
     ApplySettingDefault();
     DummyCity = new City() { Id = -1, Name = "-select-" };
     DummyAssociation = new Association() { Id = -1, Name = "-ALL ASSOCIATIONS-" };
     DummyCountry = new Country() { Id = -1, Name = "-ALL COUNTRIES-", HasStates = true, DisplayStates = true };
     DummyState = new State() { Id = -1, Name = "-select-" };
 }
示例#6
0
文件: State.cs 项目: felixthehat/Limo
     public bool Equals(State other)
     {
         if (ReferenceEquals(null, other)) return false;
         if (ReferenceEquals(this, other)) return true;
 		if (other.Id == 0 && Id == 0)
 			return false;
 		else
 			return other.Id == Id;
     }