Exemple #1
0
        private static PxzFile LoadPxz(string fileName, bool waitWindow = true)
        {
            //multi-threaded handler
            if (waitWindow)
            {
                return((PxzFile)WaitWindow.WaitWindow.Show(LoadPxz, @"Loading PXZ file", fileName));
            }

            try
            {
                //ensure the file exists
                if (File.Exists(fileName))
                {
                    //attempt PXZ load
                    var pxz = new PxzFile();
                    pxz.Load(fileName);

                    //return the loaded PXZ file
                    return(pxz);
                }
            }
            catch (Exception ex)
            {
                UIMessages.Error(ex.ToString(), @"Load PXZ File Error");
            }

            //default
            return(null);
        }
Exemple #2
0
        public static PxzFile LoadMetadataArchive(string fileName, bool waitWindow = true)
        {
            if (waitWindow)
            {
                var waitArgs = new object[] { fileName };
                return((PxzFile)WaitWindow.WaitWindow.Show(LoadMetadataArchive, @"Loading PXZ", waitArgs));
            }

            try
            {
                var pxz = new PxzFile();
                pxz.Load(fileName);

                return(pxz);
            }
            catch (Exception ex)
            {
                LoggingHelpers.RecordException(ex.Message, "XmlMetadataLoadError");
                return(null);
            }
        }