Esempio n. 1
0
        /// <summary> recursively write out a node of the instance</summary>
        /// <param name="out">
        /// </param>
        /// <param name="e">
        /// </param>
        /// <param name="ref">
        /// </param>
        /// <throws>  IOException </throws>
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        private void  writeTreeElement(System.IO.BinaryWriter out_Renamed, TreeElement e)
        {
            TreeElement templ   = instance.getTemplatePath(e.Ref);
            bool        isGroup = !templ.Leaf;

            if (isGroup)
            {
                System.Collections.ArrayList childTypesHandled = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
                for (int i = 0; i < templ.NumChildren; i++)
                {
                    System.String childName = templ.getChildAt(i).Name;
                    if (!childTypesHandled.Contains(childName))
                    {
                        childTypesHandled.Add(childName);

                        int mult = e.getChildMultiplicity(childName);
                        if (mult > 0 && !e.getChild(childName, 0).isRelevant())
                        {
                            mult = 0;
                        }

                        ExtUtil.writeNumeric(out_Renamed, mult);
                        for (int j = 0; j < mult; j++)
                        {
                            writeTreeElement(out_Renamed, e.getChild(childName, j));
                        }
                    }
                }
            }
            else
            {
                ExtUtil.write(out_Renamed, new ExtWrapAnswerData(this, e.DataType, e.Value));
            }
        }
Esempio n. 2
0
        /// <summary>Write the group definition object to the supplied stream. </summary>
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public virtual void  writeExternal(System.IO.BinaryWriter dos)
        {
            ExtUtil.writeNumeric(dos, ID);
            ExtUtil.write(dos, new ExtWrapNullable(AppearanceAttr));
            ExtUtil.write(dos, new ExtWrapTagged(Bind));
            ExtUtil.write(dos, new ExtWrapNullable(TextID));
            ExtUtil.write(dos, new ExtWrapNullable(LabelInnerText));
            ExtUtil.writeBool(dos, Repeat);
            ExtUtil.write(dos, new ExtWrapListPoly(Children));

            ExtUtil.writeBool(dos, noAddRemove);
            ExtUtil.write(dos, new ExtWrapNullable(count != null?new ExtWrapTagged(count):null));

            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(chooseCaption));
            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(addCaption));
            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(delCaption));
            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(doneCaption));
            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(addEmptyCaption));
            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(doneEmptyCaption));
            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(entryHeader));
            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(delHeader));
            ExtUtil.writeString(dos, ExtUtil.emptyIfNull(mainHeader));

            ExtUtil.writeAttributes(dos, additionalAttributes);
        }
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     out_Renamed.Write(data.Length);
     for (int i = 0; i < data.Length; ++i)
     {
         ExtUtil.write(out_Renamed, new ExtWrapTagged(data[i]));
     }
 }
Esempio n. 4
0
        /* (non-Javadoc)
         * @see org.javarosa.core.services.storage.utilities.Externalizable#writeExternal(java.io.DataOutputStream)
         */
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            ExtUtil.write(out_Renamed, new ExtWrapNullable(Id));
            ExtUtil.writeNumeric(out_Renamed, DataType);
            ExtUtil.write(out_Renamed, new ExtWrapNullable(Preload));
            ExtUtil.write(out_Renamed, new ExtWrapNullable(PreloadParams));
            ExtUtil.write(out_Renamed, new ExtWrapTagged(ref_Renamed));

            //don't bother writing relevancy/required/readonly/constraint/calculate/additionalAttrs right now; they're only used during parse anyway
        }
Esempio n. 5
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public override void  writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            ExtUtil.write(out_Renamed, target);

            ExtUtil.write(out_Renamed, ExtUtil.emptyIfNull(explicitValue));
            if (explicitValue == null)
            {
                ExtUtil.write(out_Renamed, new ExtWrapTagged(value_Renamed));
            }
        }
Esempio n. 6
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public override void  writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            System.Collections.ArrayList v = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
            for (int i = 0; i < predicates.Length; i++)
            {
                v.Add(predicates[i]);
            }

            ExtUtil.write(out_Renamed, new ExtWrapTagged(x));
            ExtUtil.write(out_Renamed, new ExtWrapListPoly(v));
        }
Esempio n. 7
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, nodesetRef);
     ExtUtil.write(out_Renamed, new ExtWrapTagged(nodesetExpr));
     ExtUtil.write(out_Renamed, contextRef);
     ExtUtil.write(out_Renamed, labelRef);
     ExtUtil.write(out_Renamed, new ExtWrapTagged(labelExpr));
     ExtUtil.write(out_Renamed, new ExtWrapNullable(valueRef));
     ExtUtil.write(out_Renamed, new ExtWrapNullable(valueExpr == null?null:new ExtWrapTagged(valueExpr)));
     ExtUtil.write(out_Renamed, new ExtWrapNullable(copyRef));
     ExtUtil.writeBool(out_Renamed, labelIsItext);
     ExtUtil.writeBool(out_Renamed, copyMode);
 }
Esempio n. 8
0
        /// <summary> serialize a compact instance</summary>
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            if (instance == null)
            {
                throw new System.SystemException("instance has not yet been set via setData()");
            }

            ExtUtil.writeNumeric(out_Renamed, instance.FormId);
            ExtUtil.writeNumeric(out_Renamed, instance.ID);
            ExtUtil.write(out_Renamed, new ExtWrapNullable(instance.DateSaved));

            writeTreeElement(out_Renamed, instance.getRoot());
        }
Esempio n. 9
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public override void  writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            ExtUtil.writeNumeric(out_Renamed, init_context);
            if (init_context == INIT_CONTEXT_EXPR)
            {
                ExtUtil.write(out_Renamed, filtExpr);
            }

            System.Collections.ArrayList v = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
            for (int i = 0; i < steps.Length; i++)
            {
                v.Add(steps[i]);
            }
            ExtUtil.write(out_Renamed, new ExtWrapList(v));
        }
Esempio n. 10
0
        /*
         * (non-Javadoc)
         * @see org.javarosa.core.util.Externalizable#writeExternal(java.io.DataOutputStream)
         */
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public virtual void  writeExternal(System.IO.BinaryWriter dos)
        {
            ExtUtil.writeNumeric(dos, ID);
            ExtUtil.write(dos, new ExtWrapNullable(binding == null?null:new ExtWrapTagged(binding)));
            ExtUtil.write(dos, new ExtWrapNullable(AppearanceAttr));
            ExtUtil.write(dos, new ExtWrapNullable(TextID));
            ExtUtil.write(dos, new ExtWrapNullable(LabelInnerText));
            ExtUtil.write(dos, new ExtWrapNullable(HelpText));
            ExtUtil.write(dos, new ExtWrapNullable(HelpTextID));
            ExtUtil.write(dos, new ExtWrapNullable(HelpInnerText));

            ExtUtil.writeNumeric(dos, ControlType);

            ExtUtil.writeAttributes(dos, additionalAttributes);

            ExtUtil.write(dos, new ExtWrapList(ExtUtil.emptyIfNull(choices)));
            ExtUtil.write(dos, new ExtWrapNullable(dynamicChoices));
        }
Esempio n. 11
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            ExtUtil.writeNumeric(out_Renamed, axis);
            ExtUtil.writeNumeric(out_Renamed, test);

            switch (test)
            {
            case TEST_NAME:  ExtUtil.write(out_Renamed, name); break;

            case TEST_NAMESPACE_WILDCARD:  ExtUtil.writeString(out_Renamed, namespace_Renamed); break;

            case TEST_TYPE_PROCESSING_INSTRUCTION:  ExtUtil.write(out_Renamed, new ExtWrapNullable(literal)); break;
            }

            System.Collections.ArrayList v = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
            for (int i = 0; i < predicates.Length; i++)
            {
                v.Add(predicates[i]);
            }
            ExtUtil.write(out_Renamed, new ExtWrapListPoly(v));
        }
Esempio n. 12
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, new ExtWrapTagged(constraint));
     ExtUtil.writeString(out_Renamed, ExtUtil.emptyIfNull(constraintMsg));
 }
Esempio n. 13
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, new ExtWrapList(v));
 }
Esempio n. 14
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, s);
 }
Esempio n. 15
0
 /* (non-Javadoc)
  * @see org.javarosa.core.services.storage.utilities.Externalizable#writeExternal(java.io.DataOutputStream)
  */
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.writeString(out_Renamed, ExtUtil.emptyIfNull(nodeset));
     ExtUtil.write(out_Renamed, ref_Renamed);
 }
Esempio n. 16
0
            //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
            public override void  writeExternal(System.IO.BinaryWriter out_Renamed)
            {
                if (val == null)
                {
                    out_Renamed.Write((System.Byte) 0x00);
                }
                else
                {
                    sbyte          prefix = (sbyte)(0x01);
                    Externalizable serEntity;

                    if (dataType < 0 || dataType >= 100)
                    {
                        //custom data types
                        serEntity = new ExtWrapTagged(val);
                    }
                    else if (val is SelectOneData)
                    {
                        serEntity = new ExtWrapBase(Enclosing_Instance.compactSelectOne((SelectOneData)val));
                    }
                    else if (val is SelectMultiData)
                    {
                        serEntity = new ExtWrapList(Enclosing_Instance.compactSelectMulti((SelectMultiData)val));
                    }
                    else
                    {
                        serEntity = (IAnswerData)val;

                        //flag when data type differs from the default data type in the <bind> (can happen with 'calculate's)
                        if (val.GetType() != org.javarosa.core.model.instance.utils.CompactInstanceWrapper.classForDataType(dataType))
                        {
                            if (val is StringData)
                            {
                                prefix = (sbyte)(0x40);
                            }
                            else if (val is IntegerData)
                            {
                                prefix = (sbyte)(0x41);
                            }
                            else if (val is DecimalData)
                            {
                                prefix = (sbyte)(0x42);
                            }
                            else if (val is DateData)
                            {
                                prefix = (sbyte)(0x43);
                            }
                            else if (val is BooleanData)
                            {
                                prefix = (sbyte)(0x44);
                            }
                            else
                            {
                                throw new System.SystemException("divergent data type not allowed");
                            }
                        }
                    }

                    out_Renamed.Write((byte)prefix);
                    ExtUtil.write(out_Renamed, serEntity);
                }
            }
Esempio n. 17
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public override void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, id);
 }
Esempio n. 18
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public override void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, new ExtWrapTagged(a));
     ExtUtil.write(out_Renamed, new ExtWrapTagged(b));
 }
Esempio n. 19
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, new ExtWrapNullable(namespace_Renamed));
     ExtUtil.writeString(out_Renamed, name);
 }
Esempio n. 20
0
 /*
  * (non-Javadoc)
  * @see org.javarosa.core.util.externalizable.Externalizable#writeExternal(java.io.DataOutputStream)
  */
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, new ExtWrapTagged(pointer));
 }
Esempio n. 21
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public virtual void  writeExternal(System.IO.BinaryWriter out_Renamed)
 {
     ExtUtil.write(out_Renamed, new ExtWrapTagged(expr));
     ExtUtil.writeBool(out_Renamed, hasNow);
 }