public void Unload(int i) { if (!Loaded.Contains(i)) { return; } Loaded.Remove(i); }
/// <summary> /// </summary> public void UnloadPlugin(string name) { var plugin = Loaded.Find(name); if (plugin != null) { plugin.Instance.Dispose(); Loaded.Remove(plugin); } }
// Unload all loaded extensions public static void Unload() { if (Loaded == null) { return; } foreach (KeyValuePair <string, IExtension> ext in Loaded) { ext.Value.Kill(); Loaded.Remove(ext.Key); } Loaded = null; }
private static void OnUnloadedCommandPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is FrameworkElement element && e.NewValue is ICommand command) { if (!Unloaded.Contains(element)) { Unloaded.Add(element); element.Unloaded += (s, a) => { command.Execute(null); Loaded.Remove(element); Unloaded.Remove(element); }; } } }
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); } } }