Example #1
0
        /// <summary>添加处理器</summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public Binary AddHandler(IBinaryHandler handler)
        {
            if (handler != null)
            {
                handler.Host = this;
                Handlers.Add(handler);
                // 根据优先级排序
                (Handlers as List <IBinaryHandler>).Sort();
            }

            return(this);
        }
Example #2
0
        /// <summary>添加处理器</summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public Binary AddHandler(IBinaryHandler handler)
        {
            if (handler != null)
            {
                handler.Host = this;
                Handlers.Add(handler);
                // 根据优先级排序
                Handlers = Handlers.OrderBy(e => e.Priority).ToList();
            }

            return(this);
        }
Example #3
0
 // If the image changes, then the in-memory image needs to be unloaded
 void FileHandler_ContentsChanged(IBinaryHandler sender, EventArgs e)
 {
     FileHandler.ContentsChanged -= new EventHandler<IBinaryHandler, EventArgs>(FileHandler_ContentsChanged);
     _Image = null;
 }
Example #4
0
 void BinaryHandler_ContentsChanged(IBinaryHandler sender, EventArgs e)
 {
     foreach (string cachedView in Directory.GetFiles(CachePath, "*.cached"))
         File.Delete(cachedView);
 }