Esempio n. 1
0
        public override DcmElement Put(DcmElement newElem)
        {
            uint tag = newElem.tag();
            if ((tag & 0xFFFF0000) != 0x00020000) {
                throw new ArgumentException(newElem.ToString());
            }

            try {
                switch (tag) {
                    case Tags.MediaStorageSOPClassUniqueId:
                        _sopClassUniqueId = newElem.GetString(null);
                        break;

                    case Tags.MediaStorageSOPInstanceUID:
                        _sopInstanceUniqueId = newElem.GetString(null);
                        break;

                    case Tags.TransferSyntaxUniqueId:
                        _tsUniqueId = newElem.GetString(null);
                        break;

                    case Tags.ImplementationClassUID:
                        _implementationClassUniqueId = newElem.GetString(null);
                        break;

                    case Tags.ImplementationVersionName:
                        _implementationVersionName = newElem.GetString(null);
                        break;
                }
            }
            catch (DcmValueException) {
                throw new ArgumentException(newElem.ToString());
            }
            return base.Put(newElem);
        }
Esempio n. 2
0
        public override DcmElement Put(DcmElement newElem)
        {
            if ((newElem.tag()) >> 16 < 4) {
                throw new ArgumentException(newElem.ToString());
            }

            if (newElem.tag() == Tags.SpecificCharacterSet) {
                try {
                    //TODO: decide the encoding
                    //this.encoding = Encodings.lookup(newElem.GetStrings(null));
                }
                catch (Exception ex) {
                    Logger.Warn("Failed to consider specified Encoding!", ex);
                    _encoding = null;
                }
            }

            return base.Put(newElem);
        }