Example #1
0
        private double CloseFiles(bool logTimming = false)
        {
            var count = mapIds.Count();
            var i     = 0;
            var time  = Helper.GetExecutionTime(() =>
            {
                foreach (var id in mapIds.ToArray())
                {
                    i++;
                    var fileTime = Helper.GetExecutionTime(() =>
                    {
                        CloseTile(id);
                        mapIds.Remove(id);
                        Zoom();
                        MessagePump.DoEvents();
                    });
                    if (logTimming)
                    {
                        Helper.Log(">>> CLOSE FILE {0}/{1}   {2:0.00}", i, count, fileTime);
                    }
                    else
                    {
                        Helper.Trace(">>> CLOSE FILE {0}/{1}   {2:0.00}", i, count, fileTime);
                    }
                }
            });

            return(time);
        }
Example #2
0
        private double OpenFiles(IEnumerable <string> filePaths, bool logTimming = false)
        {
            var count = filePaths.Count();
            var i     = 0;
            var time  = Helper.GetExecutionTime(() =>
            {
                foreach (var filePath in filePaths)
                {
                    i++;
                    var fileTime = Helper.GetExecutionTime(() =>
                    {
                        var id = OpenTile(filePath);
                        mapIds.Add(id);
                        Zoom();
                        MessagePump.DoEvents();
                    });
                    if (logTimming)
                    {
                        Helper.Log(">>> OPEN FILE {1}/{2}   {3:0.00}   {0}", filePath, i, count, fileTime);
                    }
                    else
                    {
                        Helper.Trace(">>> OPEN FILE {1}/{2}   {3:0.00}   {0}", filePath, i, count, fileTime);
                    }
                }
            });

            return(time);
        }