protected ViewModelBase() { if (!Loaded.Contains(this)) { Loaded.Add(this); } }
public void Unload(int i) { if (!Loaded.Contains(i)) { return; } Loaded.Remove(i); }
public void Load(int i) { if (Loaded.Contains(i)) { return; } Loaded.Add(i); }
public void Load(int i) { if (Loaded.Contains(i)) { return; } Loaded.Add(i); LoadQueue.Enqueue(i); }
private static void OnLoadedCommandPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is FrameworkElement element && e.NewValue is ICommand command) { if (!Loaded.Contains(element)) { Loaded.Add(element); element.Loaded += (s, a) => command.Execute(null); } } }
private void CheckFunc(PointOctreeNode <Integer> .OctreeObject octreeObject) { var objectPosition = DataSet[octreeObject.Obj].Position; var distanceCurrent = Vector3.Distance(cachePosition, objectPosition); if (distanceCurrent > NearRadius && distanceCurrent < FarRadius && !Loaded.Contains(octreeObject.Obj)) { Loaded.Add(octreeObject.Obj); lock (LoadQueue) { LoadQueue.Enqueue(octreeObject.Obj); } } else if ((distanceCurrent < NearRadius || distanceCurrent > FarRadius) && Loaded.Contains(octreeObject.Obj)) { Loaded.Remove(octreeObject.Obj); lock (UnloadQueue) { UnloadQueue.Enqueue(octreeObject.Obj); } } }