コード例 #1
0
        public void Unload(int i)
        {
            if (!Loaded.Contains(i))
            {
                return;
            }

            Loaded.Remove(i);
        }
コード例 #2
0
ファイル: PluginHost.cs プロジェクト: Arzzz/ffxivapp
        /// <summary>
        /// </summary>
        public void UnloadPlugin(string name)
        {
            var plugin = Loaded.Find(name);

            if (plugin != null)
            {
                plugin.Instance.Dispose();
                Loaded.Remove(plugin);
            }
        }
コード例 #3
0
        // 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;
        }
コード例 #4
0
 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);
             };
         }
     }
 }
コード例 #5
0
        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);
                }
            }
        }