Пример #1
0
 private static void WndWithOpenFile(IOpenFileProcessor opr)
 {
     //by chennan 窗口上下文
     if (opr is IRasterFileProcessor)
     {
         //CmdExecute(9000);
         //CmdExecute(1004);
     }
 }
Пример #2
0
        public static bool SupportOpenFile(string fname)
        {
            string hdrFile = Path.Combine(Path.GetDirectoryName(fname), Path.GetFileNameWithoutExtension(fname) + ".hdr");

            if (File.Exists(hdrFile))
            {
                IOpenFileProcessor pro = GetRasterFileProcessor();
                if (pro != null)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #3
0
        private static bool CountIsAllowed(IOpenFileProcessor opr)
        {
            if (!(opr is IRasterFileOpenedCountable) || ALLOW_MAX_RASTER_COUNT < 1)
            {
                return(true);
            }
            var v = _session.SmartWindowManager.GetSmartWindows((wnd) => { return(wnd is ICanvasViewer); });

            if (v == null || v.Count() < ALLOW_MAX_RASTER_COUNT)
            {
                return(true);
            }
            return(false);
        }
Пример #4
0
        private static bool TryOpenFile(string fname, string[] options)
        {
            string hdrFile = Path.Combine(Path.GetDirectoryName(fname), Path.GetFileNameWithoutExtension(fname) + ".hdr");

            if (File.Exists(hdrFile))
            {
                IOpenFileProcessor pro = GetRasterFileProcessor();
                if (pro != null)
                {
                    bool memoryIsNotEnough = false;
                    return(pro.Open(fname, out memoryIsNotEnough));
                }
            }
            return(false);
        }
Пример #5
0
 private static void TryOpenOvervierWnd(IOpenFileProcessor opr)
 {
     try
     {
         if (opr is IRasterFileProcessor)
         {
             //CommandOverviewWnd
             ICommand cmd = _session.CommandEnvironment.Get(9007);
             if (cmd != null)
             {
                 cmd.Execute();
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("TryOpenOvervierWnd:" + ex.Message);
     }
 }