示例#1
0
        /// <summary>
        /// Dispose of this temporary raster
        /// </summary>
        /// <param name="disposing"></param>
        private void Dispose(bool disposing)
        {
            // Make sure we've freed up all the handles on the file
            UnloadDS();

            // Don't clean up this file unless it's marked temporary
            if (!_temporary)
            {
                return;
            }

            // Don't call the destructor if we're explicitly disposing of this.
            if (disposing)
            {
                GC.SuppressFinalize(this);
            }

            // Make sure to refresh and check
            GISFileInfo.Refresh();
            if (GISFileInfo.Exists)
            {
                try { Delete(); }
                catch (Exception e)
                {
                    Debug.WriteLine(e.ToString());
                } // best effort only
                GISFileInfo.Refresh();
            }
        }
示例#2
0
 /// <summary>
 /// FileInfo does not refresh until you tell it to. Use this when you create or destroy a file
 /// </summary>
 public void RefreshFileInfo()
 {
     GISFileInfo.Refresh();
 }
示例#3
0
 public bool FileExists()
 {
     GISFileInfo.Refresh();
     return(GISFileInfo != null && GISFileInfo.Exists);
 }