예제 #1
0
        public override void Execute(string argument)
        {
            if (argument == null)
            {
                return;
            }
            IRasterDataProvider prd = null;

            try
            {
                prd = GeoDataDriver.Open(argument) as IRasterDataProvider;
            }
            catch (Exception ex)
            {
                ExceptionHandler.ShowExceptionWnd(ex, "为文件\"" + Path.GetFileName(argument) + "\"创建金字塔失败!");
                return;
            }
            if (prd == null)
            {
                return;
            }
            if (prd.IsSupprtOverviews)
            {
                IProgressMonitor progress = _smartSession.ProgressMonitorManager.DefaultProgressMonitor;
                try
                {
                    string tip = "正在建立金字塔\"" + Path.GetFileName(argument) + "\"...";
                    progress.Reset(tip, 100);
                    progress.Start(false);
                    prd.BuildOverviews((idx, tipo) => { progress.Boost(idx, tip); });
                }
                finally
                {
                    progress.Finish();
                }
            }
        }