private static void WndWithOpenFile(IOpenFileProcessor opr) { //by chennan 窗口上下文 if (opr is IRasterFileProcessor) { //CmdExecute(9000); //CmdExecute(1004); } }
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); }
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); }
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); }
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); } }