Example #1
0
        private Wz_Png GetLinkedPng(Wz_Node node)
        {
            var wzFile = node.GetNodeWzFile();

            if (wzFile != null)
            {
                var linkNode = node.GetLinkedSourceNode(path =>
                                                        PluginBase.PluginManager.FindWz(path, wzFile));

                //添加回收池机制...
                if (linkNode != null)
                {
                    var linkImg = linkNode.GetNodeWzImage();
                    if (linkImg != null && !_currentWzImg.Contains(linkImg))
                    {
                        if (_disposeQueue == null)
                        {
                            _disposeQueue = new DisposeQueue(32);
                        }
                        _disposeQueue.Add(linkImg, _currentWzImg);
                    }
                }

                return(linkNode.GetValueEx <Wz_Png>(null));
            }
            return(null);
        }
Example #2
0
 void CleanupDisposeQueue()
 {
     lock (this)
     {
         while (DisposeQueue.Count > 0)
         {
             var  bmp     = DisposeQueue.Dequeue();
             bool dispose = true;
             if (ReleaseCallback != null)
             {
                 dispose = ReleaseCallback(bmp);
             }
             if (dispose)
             {
                 bmp.Dispose();
             }
         }
     }
 }