상속: FirstFloor.ModernUI.Presentation.NotifyPropertyChanged, IWithId
예제 #1
0
        public async Task <T> EnsureWrapperLoadedAsync([NotNull] AcItemWrapper wrapper)
        {
            if (wrapper == null)
            {
                throw new ArgumentNullException(nameof(wrapper));
            }

            if (wrapper.IsLoaded)
            {
                return((T)wrapper.Value);
            }

            var value = await Task.Run(() => CreateAndLoadAcObject(wrapper.Id, wrapper.Value.Enabled, false));

            wrapper.Value = value;
            return(value);
        }
예제 #2
0
        public T EnsureWrapperLoaded([NotNull] AcItemWrapper wrapper)
        {
            if (wrapper == null)
            {
                throw new ArgumentNullException(nameof(wrapper));
            }

            lock (wrapper) {
                if (wrapper.IsLoaded)
                {
                    return((T)wrapper.Value);
                }

                var value = CreateAndLoadAcObject(wrapper.Id, wrapper.Value.Enabled);
                wrapper.Value = value;
                return(value);
            }
        }
예제 #3
0
        protected void ReplaceInList([NotNull] string oldId, AcItemWrapper newItem)
        {
            if (oldId == null)
            {
                throw new ArgumentNullException(nameof(oldId));
            }
            var wrapper = GetWrapperById(oldId);

            if (wrapper == null)
            {
                return;
            }
            if (wrapper.IsLoaded)
            {
                ((AcObjectNew)wrapper.Value).Outdate();
            }
            InnerWrappersList.Replace(wrapper, newItem);
            UpdateList(true);
            ResetLoading();
        }
예제 #4
0
 protected void AddInList(AcItemWrapper newItem)
 {
     InnerWrappersList.Add(newItem);
     UpdateList(true);
     ResetLoading();
 }
예제 #5
0
 public CarOrOnlyCarIdEntry(string carId, AcItemWrapper carObjectWrapper = null) {
     CarId = carId;
     CarObjectWrapper = carObjectWrapper;
 }