Beispiel #1
0
        ///
        ///	 <summary> * does this ColorPool have Color elements with identical Name or RawName
        ///	 * eattributes return false if no Color elements with identical Name or
        ///	 * RawName tags exist </summary>
        ///
        public virtual VString getDuplicateColors()
        {
            VElement v = getChildElementVector(ElementName.COLOR, null, null, true, 0, false);

            SupportClass.HashSetSupport <string> vName = new SupportClass.HashSetSupport <string>();
            int     nCols = v.Count;
            VString vRet  = new VString();

            for (int i = 0; i < nCols; i++)
            {
                JDFColor color     = (JDFColor)v[i];
                string   colorName = color.getName();
                if (vName.Contains(colorName))
                {
                    vRet.appendUnique(colorName);
                }
                string rawName = color.get8BitName();
                if (vName.Contains(rawName))
                {
                    vRet.appendUnique(colorName);
                }
                vName.Add(colorName);
                vName.Add(rawName);
            }

            return(vRet.Count == 0 ? null : vRet);
        }
 /// <summary> Calls <code>loadProperties()</code> if it has not been called before for
 /// the given file.  If the given property file has already been loaded, this
 /// method does nothing.
 /// </summary>
 public static void  loadOnce(System.String propertyFileName)
 {
     if (!files.Contains(propertyFileName))
     {
         loadProperties(propertyFileName);
         files.Add(propertyFileName);
     }
 }
Beispiel #3
0
 public virtual void testUniqueID()
 {
     // Java to C# Conversion, Test taking too long, reduce count from original 200,000 for now
     SupportClass.HashSetSupport m = new SupportClass.HashSetSupport();
     for (int i = 0; i < 1000; i++)
     {
         string s = JDFElement.uniqueID(0);
         if (m.Contains(s))
         {
             Assert.Fail("oops");
         }
         m.Add(s);
     }
 }
Beispiel #4
0
        /// <summary>   Populates the given Segment object with data from the given XML Element. </summary>
        /// <summary>   for the given Segment, or if there is an error while setting individual field
        ///             values. </summary>
        ///
        /// <param name="segmentObject">    The segment object. </param>
        /// <param name="segmentElement">   Element describing the segment. </param>

        public virtual void Parse(ISegment segmentObject, System.Xml.XmlElement segmentElement)
        {
            SupportClass.HashSetSupport done = new SupportClass.HashSetSupport();

            //        for (int i = 1; i <= segmentObject.NumFields(); i++) {
            //            String elementName = makeElementName(segmentObject, i);
            //            done.add(elementName);
            //            parseReps(segmentObject, segmentElement, elementName, i);
            //        }

            System.Xml.XmlNodeList all = segmentElement.ChildNodes;
            for (int i = 0; i < all.Count; i++)
            {
                System.String elementName = all.Item(i).Name;
                if (System.Convert.ToInt16(all.Item(i).NodeType) == (short)System.Xml.XmlNodeType.Element &&
                    !done.Contains(elementName))
                {
                    done.Add(elementName);

                    int index = elementName.IndexOf('.');
                    if (index >= 0 && elementName.Length > index)
                    {
                        //properly formatted element
                        System.String fieldNumString = elementName.Substring(index + 1);
                        int           fieldNum       = System.Int32.Parse(fieldNumString);
                        this.ParseReps(segmentObject, segmentElement, elementName, fieldNum);
                    }
                    else
                    {
                        log.Debug(
                            "Child of segment " + segmentObject.GetStructureName() + " doesn't look like a field: "
                            + elementName);
                    }
                }
            }

            //set data type of OBX-5
            if (segmentObject.GetType().FullName.IndexOf("OBX") >= 0)
            {
                Varies.fixOBX5(segmentObject, this.Factory);
            }
        }
Beispiel #5
0
        ///
        ///     <summary> * unify - make VString unique, retaining initial order </summary>
        ///
        public virtual void unify()
        {
            SupportClass.HashSetSupport <string> @set = new SupportClass.HashSetSupport <string>();
            int size = Count;

            for (int i = 0; i < size; i++)
            {
                string s = this.stringAt(i);
                if (@set.Contains(s))
                {
                    this.RemoveAt(i);
                    i--;
                    size--;
                }
                else
                {
                    @set.Add(s);
                }
            }
        }
Beispiel #6
0
        ///
        ///	 <summary> * unify - make VElement unique, retaining initial order </summary>
        ///
        public virtual void unify()
        {
            SupportClass.HashSetSupport @set = new SupportClass.HashSetSupport();
            int size = Count;

            for (int i = 0; i < size; i++)
            {
                KElement e = this.item(i);
                if (@set.Contains(e))
                {
                    this.RemoveAt(i);
                    i--;
                    size--;
                }
                else
                {
                    @set.Add(e);
                }
            }
        }
Beispiel #7
0
        public virtual void testAppendAnchor()
        {
            JDFDoc     doc = new JDFDoc("JDF");
            JDFElement e   = doc.getJDFRoot();

            SupportClass.HashSetSupport m = new SupportClass.HashSetSupport();
            KElement e2 = e.appendElement("e2");

            // Java to C# Conversion - Divide number of tests by 1000 for now
            for (int i = 0; i < 10; i++)
            {
                JDFElement appendElement = (JDFElement)e2.appendElement("FooBar");
                string     s             = appendElement.appendAnchor(null);
                if (m.Contains(s))
                {
                    Assert.Fail("oops");
                }
                Assert.AreEqual(s, appendElement.getID());
                Assert.IsTrue(s.IndexOf("..") < 0);
                m.Add(s);
            }
        }
Beispiel #8
0
        /// <summary> Populates the given Segment object with data from the given XML Element.</summary>
        /// <throws>  HL7Exception if the XML Element does not have the correct name and structure. </throws>
        /// <summary>      for the given Segment, or if there is an error while setting individual field values.
        /// </summary>
        public virtual void Parse(ISegment segmentObject, XmlElement segmentElement, ParserOptions parserOptions)
        {
            parserOptions = parserOptions ?? DefaultParserOptions;

            var done = new SupportClass.HashSetSupport();

            // for (int i = 1; i <= segmentObject.NumFields(); i++) {
            //            String elementName = makeElementName(segmentObject, i);
            //            done.add(elementName);
            //            parseReps(segmentObject, segmentElement, elementName, i);
            //        }
            var all = segmentElement.ChildNodes;

            for (var i = 0; i < all.Count; i++)
            {
                var elementName = all.Item(i).Name;
                if (Convert.ToInt16(all.Item(i).NodeType) == (short)XmlNodeType.Element && !done.Contains(elementName))
                {
                    done.Add(elementName);

                    var index = elementName.IndexOf('.');
                    if (index >= 0 && elementName.Length > index)
                    {
                        // properly formatted element
                        var fieldNumString = elementName.Substring(index + 1);
                        var fieldNum       = int.Parse(fieldNumString);
                        ParseReps(segmentObject, segmentElement, elementName, fieldNum);
                    }
                    else
                    {
                        Log.Debug("Child of segment " + segmentObject.GetStructureName() + " doesn't look like a field: " + elementName);
                    }
                }
            }

            // set data type of OBX-5
            if (segmentObject.GetType().FullName.IndexOf("OBX") >= 0)
            {
                Varies.FixOBX5(segmentObject, Factory, parserOptions);
            }
        }
Beispiel #9
0
        /// <summary> Populates the given Segment object with data from the given XML Element.</summary>
        /// <throws>  HL7Exception if the XML Element does not have the correct name and structure </throws>
        /// <summary>      for the given Segment, or if there is an error while setting individual field values.
        /// </summary>
        public virtual void  parse(Segment segmentObject, System.Xml.XmlElement segmentElement)
        {
            //UPGRADE_TODO: Class 'java.util.HashSet' was converted to 'SupportClass.HashSetSupport' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashSet'"
            SupportClass.HashSetSupport done = new SupportClass.HashSetSupport();

            //        for (int i = 1; i <= segmentObject.numFields(); i++) {
            //            String elementName = makeElementName(segmentObject, i);
            //            done.add(elementName);
            //            parseReps(segmentObject, segmentElement, elementName, i);
            //        }

            //UPGRADE_TODO: Method 'org.w3c.dom.Node.getChildNodes' was converted to 'System.Xml.XmlNode.ChildNodes' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
            System.Xml.XmlNodeList all = segmentElement.ChildNodes;
            for (int i = 0; i < all.Count; i++)
            {
                System.String elementName = all.Item(i).Name;
                if (System.Convert.ToInt16(all.Item(i).NodeType) == (short)System.Xml.XmlNodeType.Element && !done.Contains(elementName))
                {
                    done.Add(elementName);

                    int index = elementName.IndexOf('.');
                    if (index >= 0 && elementName.Length > index)
                    {
                        //properly formatted element
                        System.String fieldNumString = elementName.Substring(index + 1);
                        int           fieldNum       = System.Int32.Parse(fieldNumString);
                        parseReps(segmentObject, segmentElement, elementName, fieldNum);
                    }
                    else
                    {
                        log.debug("Child of segment " + segmentObject.getStructureName() + " doesn't look like a field: " + elementName);
                    }
                }
            }

            //set data type of OBX-5
            if (segmentObject.GetType().FullName.IndexOf("OBX") >= 0)
            {
                Varies.fixOBX5(segmentObject, Factory);
            }
        }
Beispiel #10
0
        /// <summary> Populates the given Segment object with data from the given XML Element.</summary>
        /// <throws>  HL7Exception if the XML Element does not have the correct name and structure </throws>
        /// <summary>      for the given Segment, or if there is an error while setting individual field values.
        /// </summary>
        public virtual void parse(Segment segmentObject, System.Xml.XmlElement segmentElement)
        {
            //UPGRADE_TODO: Class 'java.util.HashSet' was converted to 'SupportClass.HashSetSupport' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashSet'"
            SupportClass.HashSetSupport done = new SupportClass.HashSetSupport();

            //        for (int i = 1; i <= segmentObject.numFields(); i++) {
            //            String elementName = makeElementName(segmentObject, i);
            //            done.add(elementName);
            //            parseReps(segmentObject, segmentElement, elementName, i);
            //        }

            //UPGRADE_TODO: Method 'org.w3c.dom.Node.getChildNodes' was converted to 'System.Xml.XmlNode.ChildNodes' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073'"
            System.Xml.XmlNodeList all = segmentElement.ChildNodes;
            for (int i = 0; i < all.Count; i++)
            {
                System.String elementName = all.Item(i).Name;
                if (System.Convert.ToInt16(all.Item(i).NodeType) == (short) System.Xml.XmlNodeType.Element && !done.Contains(elementName))
                {
                    done.Add(elementName);

                    int index = elementName.IndexOf('.');
                    if (index >= 0 && elementName.Length > index)
                    {
                        //properly formatted element
                        System.String fieldNumString = elementName.Substring(index + 1);
                        int fieldNum = System.Int32.Parse(fieldNumString);
                        parseReps(segmentObject, segmentElement, elementName, fieldNum);
                    }
                    else
                    {
                        log.debug("Child of segment " + segmentObject.getStructureName() + " doesn't look like a field: " + elementName);
                    }
                }
            }

            //set data type of OBX-5
            if (segmentObject.GetType().FullName.IndexOf("OBX") >= 0)
            {
                Varies.fixOBX5(segmentObject, Factory);
            }
        }
Beispiel #11
0
 ///
 ///	 * <param name="s"> </param>
 ///	 * <param name="defaultValue"> </param>
 ///	 * <returns> default: BoolParameter(s + JDFConstants.EMPTYSTRING, false) </returns>
 ///
 public virtual bool boolParameter(string s, bool defaultValue)
 {
     return(m_flags.Contains(s) ? true : defaultValue);
 }
Beispiel #12
0
        ///
        ///	 * <param name="testRoot"> </param>
        ///	 * <param name="testlists"> </param>
        ///	 * <param name="level"> </param>
        ///	 * <param name="mrp"> </param>
        ///	 * <param name="irp"> </param>
        ///	 * <param name="resLinkPool"> </param>
        ///	 * <param name="goodElems"> </param>
        ///	 * <param name="badElems"> </param>
        ///	 * <param name="devCaps">
        ///	 * @return </param>
        ///
        public virtual void analyzeDevCaps(KElement testRoot, EnumFitsValue testlists, EnumValidationLevel level, KElement mrp, KElement irp, SupportClass.HashSetSupport goodElems, Hashtable badElems, bool ignoreExtensions)
        {
            EnumAvailability av             = getModuleAvailability();
            KElement         xpathRoot      = testRoot;
            VElement         vElemResources = null;

            if (testRoot is JDFNode)
            {
                JDFNode jdfNode = (JDFNode)testRoot;
                vElemResources = getMatchingElementsFromNode(jdfNode);
                xpathRoot      = jdfNode.getResourceLinkPool();
                if (xpathRoot == null)
                {
                    xpathRoot = testRoot;
                }
            }
            else
            {
                vElemResources = getMatchingElementsFromJMF((JDFMessage)testRoot);
            }

            int svElemResources = vElemResources == null ? 0 : vElemResources.Count;

            EnumContext context = getContext();
            KElement    r       = null;

            if (EnumValidationLevel.isRequired(level) && svElemResources < getMinOccurs() && EnumAvailability.Installed.Equals(av))
            {
                if (EnumContext.Element.Equals(context) || EnumContext.JMF.Equals(context))
                {
                    r = mrp.appendElement("MissingElement");
                    r.setAttribute("XPath", xpathRoot.buildXPath(null, 1) + "/" + getName());
                }
                else
                {
                    EnumUsage linkUsage = getLinkUsage();
                    string    procUsage = getProcessUsage();
                    r = mrp.appendElement("MissingResourceLink");
                    if (linkUsage != null)
                    {
                        r.setAttribute("Usage", linkUsage.getName());
                    }
                    if (procUsage != null && procUsage.Length > 0)
                    {
                        r.setAttribute("ProcessUsage", procUsage);
                    }
                    r.setAttribute("XPath", xpathRoot.buildXPath(null, 1) + "/" + getName());
                }
                r.setAttribute("Name", getName());
                r.setAttribute("CapXPath", getName());
                r.setAttribute("Occurrences", svElemResources, null);
                r.setAttribute("MinOccurs", getMinOccurs(), null);
            }
            else if (svElemResources > getMaxOccurs() || !EnumAvailability.Installed.Equals(av))
            {
                if (context.Equals(EnumContext.Element) || context.Equals(EnumContext.JMF))
                {
                    r = irp.appendElement("ManyElement");
                    r.setAttribute("XPath", testRoot.buildXPath(null, 1) + "/" + getName());
                }
                else
                {
                    EnumUsage linkUsage = getLinkUsage();
                    string    procUsage = getProcessUsage();
                    r = irp.appendElement("ManyResourceLink");
                    if (linkUsage != null)
                    {
                        r.setAttribute("Usage", linkUsage.getName());
                    }

                    if (procUsage != null && procUsage.Length > 0)
                    {
                        r.setAttribute("ProcessUsage", procUsage);
                    }

                    r.setAttribute("XPath", xpathRoot.buildXPath(null, 1) + "/" + getName());
                }

                r.setAttribute("Name", getName());
                r.setAttribute("CapXPath", getName());
                r.setAttribute("Occurrences", svElemResources, null);
                r.setAttribute("MaxOccurs", getMaxOccurs(), null);
                r.setAttribute("Availability", av == null ? "None" : av.getName());
            }

            if (vElemResources != null)
            {
                for (int j = 0; j < svElemResources; j++)
                {
                    KElement elem = vElemResources.item(j);
                    if (!goodElems.Contains(elem))
                    {
                        KElement report = devCapReport(elem, testlists, level, ignoreExtensions, irp); // InvalidResources
                        if (report == null)
                        {
                            goodElems.Add(elem);
                            KElement badReport = (KElement)badElems[elem];
                            if (badReport != null)
                            {
                                badReport.deleteNode();
                            }
                        }
                        else
                        {
                            badElems.Add(elem, report);
                        }
                    }
                }
            }
        }
Beispiel #13
0
        public virtual void  export(Movie m)
        {
            // define the header
            Header h = new Header();

            h.version    = m.version;
            h.compressed = Header.useCompression(m.version);
            h.size       = m.size;
            h.rate       = m.framerate;

            handler.header(h);

            // movie-wide tags
            if (m.fileAttributes != null)
            {
                if (m.metadata != null)
                {
                    m.fileAttributes.hasMetadata = true;
                }

                m.fileAttributes.visit(handler);                 // FileAttributes MUST be first tag after header!
            }
            if (m.metadata != null)
            {
                m.metadata.visit(handler);
            }
            if (m.enableDebugger != null)
            {
                m.enableDebugger.visit(handler);
            }
            if (m.uuid != null)
            {
                new DebugID(m.uuid).visit(handler);
            }
            if (m.protect != null)
            {
                m.protect.visit(handler);
            }
            if (m.scriptLimits != null)
            {
                m.scriptLimits.visit(handler);
            }
            if (m.bgcolor != null)
            {
                m.bgcolor.visit(handler);
            }
            if (m.productInfo != null)
            {
                m.productInfo.visit(handler);
            }
            if (m.sceneAndFrameLabelData != null)
            {
                m.sceneAndFrameLabelData.visit(handler);
            }

            // finally, output the frames
            bool associateRootClass = (m.topLevelClass != null);

            //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
            for (System.Collections.IEnumerator i = m.frames.GetEnumerator(); i.MoveNext();)
            {
                //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                Frame frame = (Frame)i.Current;

                if (frame.label != null)
                {
                    frame.label.visit(handler);
                }

                if (!(frame.imports.Count == 0))
                {
                    //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                    for (System.Collections.IEnumerator j = frame.imports.GetEnumerator(); j.MoveNext();)
                    {
                        //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                        ImportAssets importAssets = (ImportAssets)j.Current;
                        importAssets.visit(handler);
                    }
                }

                // definitions needed in this frame
                //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                for (System.Collections.IEnumerator j = frame.References; j.MoveNext();)
                {
                    //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                    DefineTag ref_Renamed = (DefineTag)j.Current;
                    define(ref_Renamed);
                }

                // exports
                if (frame.hasExports())
                {
                    ExportAssets exportAssets = new ExportAssets();
                    //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                    for (System.Collections.IEnumerator j = frame.exportIterator(); j.MoveNext();)
                    {
                        //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                        DefineTag tag = (DefineTag)j.Current;
                        exportAssets.exports.Add(tag);
                    }
                    exportAssets.visit(handler);
                }

                // TODO: Review this... temporarily special casing fonts here as they should not be
                // included in ExportAssets as they are not required to be exported by name!

                // fonts
                if (frame.hasFonts())
                {
                    //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                    for (System.Collections.IEnumerator k = frame.fontsIterator(); k.MoveNext();)
                    {
                        //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                        DefineFont tag = (DefineFont)k.Current;

                        // We may have already visited this font because of symbolClasses.
                        if (!done.Contains(tag))
                        {
                            tag.visit(handler);
                            done.Add(tag);
                        }
                    }
                }

                // abc tags
                //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                for (System.Collections.IEnumerator j = frame.doABCs.GetEnumerator(); j.MoveNext();)
                {
                    //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                    Tag tag = (Tag)j.Current;
                    tag.visit(handler);
                }

                SymbolClass classes = new SymbolClass();

                if (frame.hasSymbolClasses())
                {
                    SupportClass.MapSupport.PutAll(classes.class2tag, frame.symbolClass.class2tag);
                }
                if (associateRootClass)
                {
                    // only works on frame 1
                    classes.topLevelClass = m.topLevelClass;                     // Why do we do this on every frame's symclass?
                }
                if (associateRootClass || frame.hasSymbolClasses())
                {
                    classes.visit(handler);
                }
                associateRootClass = false;

                // control tags
                //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                for (System.Collections.IEnumerator j = frame.controlTags.GetEnumerator(); j.MoveNext();)
                {
                    //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                    Tag tag = (Tag)j.Current;
                    tag.visit(handler);
                }

                // then frame actions
                //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
                for (System.Collections.IEnumerator j = frame.doActions.GetEnumerator(); j.MoveNext();)
                {
                    //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
                    ActionList list = (ActionList)j.Current;
                    new DoAction(list).visit(handler);
                }

                // oh yeah, then showFrame!
                new ShowFrame().visit(handler);
            }

            handler.finish();
        }
Beispiel #14
0
        /// <summary> Populates the given Segment object with data from the given XML Element.</summary>
        /// <throws>  HL7Exception if the XML Element does not have the correct name and structure </throws>
        /// <summary>      for the given Segment, or if there is an error while setting individual field values.
        /// </summary>
        public virtual void  parse(Segment segmentObject, System.Xml.XmlElement segmentElement)
        {
            SupportClass.HashSetSupport done = new SupportClass.HashSetSupport();

            System.Xml.XmlNodeList all = segmentElement.ChildNodes;
            for (int i = 0; i < all.Count; i++)
            {
                System.String elementName = all.Item(i).Name;
                if (System.Convert.ToInt16(all.Item(i).NodeType) == (short)System.Xml.XmlNodeType.Element && !done.Contains(elementName))
                {
                    done.Add(elementName);

                    int index = elementName.IndexOf('.');
                    if (index >= 0 && elementName.Length > index)
                    {
                        //properly formatted element
                        System.String fieldNumString = elementName.Substring(index + 1);
                        int           fieldNum       = System.Int32.Parse(fieldNumString);
                        parseReps(segmentObject, segmentElement, elementName, fieldNum);
                    }
                    else
                    {
                    }
                }
            }

            //set data type of OBX-5
            if (segmentObject.GetType().FullName.IndexOf("OBX") >= 0)
            {
                Varies.fixOBX5(segmentObject, Factory);
            }
        }
		/// <summary> Populates the given Segment object with data from the given XML Element.</summary>
		/// <throws>  HL7Exception if the XML Element does not have the correct name and structure </throws>
		/// <summary>      for the given Segment, or if there is an error while setting individual field values.
		/// </summary>
		public virtual void  parse(Segment segmentObject, System.Xml.XmlElement segmentElement)
		{
			SupportClass.HashSetSupport done = new SupportClass.HashSetSupport();
			
			System.Xml.XmlNodeList all = segmentElement.ChildNodes;
			for (int i = 0; i < all.Count; i++)
			{
				System.String elementName = all.Item(i).Name;
				if (System.Convert.ToInt16(all.Item(i).NodeType) == (short) System.Xml.XmlNodeType.Element && !done.Contains(elementName))
				{
					done.Add(elementName);
					
					int index = elementName.IndexOf('.');
					if (index >= 0 && elementName.Length > index)
					{
						//properly formatted element
						System.String fieldNumString = elementName.Substring(index + 1);
						int fieldNum = System.Int32.Parse(fieldNumString);
						parseReps(segmentObject, segmentElement, elementName, fieldNum);
					}
					else
					{
					}
				}
			}
			
			//set data type of OBX-5        
			if (segmentObject.GetType().FullName.IndexOf("OBX") >= 0)
			{
				Varies.fixOBX5(segmentObject, Factory);
			}
		}