示例#1
0
        /// <summary>
        ///  Code to identify DataNorm file
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        private static TrinityAdapter InferAdapterFromFile(string path)
        {
            try
            {
                var normIdentifier = new dcm.NormIdentifyLib.NormIdentifier();
                var normInfo       = normIdentifier.IdentifyNorm(path);
                if (normInfo.Norm != dcm.NormIdentifyLib.Norm.DATANORM)
                {
                    throw new ArgumentException("Bei der ausgewählten Datei handelt es sich nicht um eine DATANORM Datei");
                }
                switch (normInfo.Version)
                {
                case "3":
                    FileVerison = "DN3";
                    return(TrinityAdapter.ImportDN3);

                case "4":

                    FileVerison = "DN4";
                    return(TrinityAdapter.ImportDN4);

                case "5":
                    FileVerison = "DN5";
                    return(TrinityAdapter.ImportDN5);

                default: throw new InvalidOperationException("Bei der ausgewählten Datei handelt es sich nicht um eine bekannte DATANORM Datei");
                }
            }
            catch (Exception ex) { throw ex; }
        }
示例#2
0
        private static TrinityAdapter InferAdapterFromFile(string path)
        {
            var normIdentifier = new dcm.NormIdentifyLib.NormIdentifier();

            var normInfo = normIdentifier.IdentifyNorm(path);

            if (normInfo.Norm != dcm.NormIdentifyLib.Norm.DATANORM)
            {
                throw new ArgumentException("Not a DATANORM file");
            }

            switch (normInfo.Version)
            {
            case "3": return(TrinityAdapter.ImportDN3);

            case "4": return(TrinityAdapter.ImportDN4);

            case "5": return(TrinityAdapter.ImportDN5);

            default: throw new InvalidOperationException("Not a known DATANORM version");
            }
        }