internal SingleType(SerializationInfo info, StreamingContext context) :
     base(DataType.Single)
 {
     m_oSingle = info.GetSingle("data");
 }
Example #2
0
 public Vector3(SerializationInfo info, StreamingContext context)
 {
     _x = info.GetSingle("_x");
     _y = info.GetSingle("_y");
     _z = info.GetSingle("_z");
 }
Example #3
0
 public ItemDropDataItem(SerializationInfo _Info, StreamingContext _Context)
 {
     m_Boss       = (WowBoss)_Info.GetInt32("m_Boss");
     m_DropChance = _Info.GetSingle("m_DropChance");
 }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Matrix4D"/> class with serialized data.
        /// </summary>
        /// <param name="info">The object that holds the serialized object data.</param>
        /// <param name="context">The contextual information about the source or destination.</param>
        private Matrix4D(SerializationInfo info, StreamingContext context)
        {
            // Get the first row
            _m11 = info.GetSingle("M11");
            _m12 = info.GetSingle("M12");
            _m13 = info.GetSingle("M13");
            _m14 = info.GetSingle("M14");

            // Get the second row
            _m21 = info.GetSingle("M21");
            _m22 = info.GetSingle("M22");
            _m23 = info.GetSingle("M23");
            _m24 = info.GetSingle("M24");

            // Get the third row
            _m31 = info.GetSingle("M31");
            _m32 = info.GetSingle("M32");
            _m33 = info.GetSingle("M33");
            _m34 = info.GetSingle("M34");

            // Get the fourth row
            _m41 = info.GetSingle("M41");
            _m42 = info.GetSingle("M42");
            _m43 = info.GetSingle("M43");
            _m44 = info.GetSingle("M44");
        }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ComplexF"/> class with serialized data.
 /// </summary>
 /// <param name="info">The object that holds the serialized object data.</param>
 /// <param name="context">The contextual information about the source or destination.</param>
 private ComplexF(SerializationInfo info, StreamingContext context)
 {
     _real  = info.GetSingle("Real");
     _image = info.GetSingle("Imaginary");
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Vector2F"/> class with serialized data.
 /// </summary>
 /// <param name="info">The object that holds the serialized object data.</param>
 /// <param name="context">The contextual information about the source or destination.</param>
 private Circle(SerializationInfo info, StreamingContext context)
 {
     this.center = (Vector2F)info.GetValue("Center", typeof(Vector2F));
     this.radius = info.GetSingle("Radius");
 }
Example #7
0
        protected HavokNavMeshShape(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            m_saveInputSnapshot = info.GetBoolean("SaveInputSnapshot");
            m_snapshotFilename  = info.GetString("SnapshotFilename");
            if (SerializationHelper.HasElement(info, "NavmeshFilename"))
            {
                m_navMeshFilename = info.GetString("NavmeshFilename");
            }
            if (SerializationHelper.HasElement(info, "DebugRenderOffset"))
            {
                m_debugRenderOffset = info.GetSingle("DebugRenderOffset");
            }

            // check if it has a reference to a global settings shape already
            if (SerializationHelper.HasElement(info, "NavMeshGlobalSettingsName"))
            {
                m_navMeshGlobalSettingsName = info.GetString("NavMeshGlobalSettingsName");
            }
            else
            {
                // get the AI panel
                HavokAiPanel aiPanel = HavokAiPanel.GetInstance();
                System.Diagnostics.Debug.Assert(aiPanel != null);

                // if not, this is from an old version of the scene, so create a new settings struct and transfer all settings to this struct
                HavokNavMeshGlobalSettings globalSettings = aiPanel.CreateGlobalSettings(this.ToString() + "_GlobalSettings", false);
                m_navMeshGlobalSettingsName = globalSettings.Name;
                System.Diagnostics.Debug.Assert(globalSettings != null);

                // Nav Mesh Generation Settings
                globalSettings.CharacterHeight  = info.GetSingle("CharacterHeight");
                globalSettings.MaxWalkableSlope = info.GetSingle("MaxWalkableSlope");
                globalSettings.MinRegionArea    = info.GetSingle("MinRegionArea");
                if (SerializationHelper.HasElement(info, "MinDistanceToSeedPoints"))
                {
                    globalSettings.MinDistanceToSeedPoints = info.GetSingle("MinDistanceToSeedPoints");
                }
                if (SerializationHelper.HasElement(info, "BorderPreservationTolerance"))
                {
                    globalSettings.BorderPreservationTolerance = info.GetSingle("BorderPreservationTolerance");
                }
                globalSettings.MinCharacterWidth   = info.GetSingle("MinCharacterWidth");
                globalSettings.CharacterWidthUsage = (eCharacterWidthUsage)info.GetValue("CharacterWidthUsage", typeof(eCharacterWidthUsage));
                if (SerializationHelper.HasElement(info, "RestrictToZoneGeometry"))
                {
                    globalSettings.RestrictToInputGeometryFromSameZone = info.GetBoolean("RestrictToZoneGeometry");
                }

                // Nav Mesh Generation Settings (Advanced)
                globalSettings.QuantizationGridSize     = info.GetSingle("QuantizationGridSize");
                globalSettings.DegenerateAreaThreshold  = info.GetSingle("DegenerateAreaThreshold");
                globalSettings.DegenerateWidthThreshold = info.GetSingle("DegenerateWidthThreshold");
                globalSettings.ConvexThreshold          = info.GetSingle("ConvexThreshold");
                globalSettings.MaxNumEdgesPerFace       = info.GetInt32("MaxNumEdgesPerFace");
                globalSettings.WeldInputVertices        = info.GetBoolean("WeldInputVertices");
                globalSettings.WeldThreshold            = info.GetSingle("WeldThreshold");

                // Nav Mesh Edge Matching Settings
                globalSettings.EdgeConnectionIterations = info.GetInt32("EdgeConnectionIterations");
                globalSettings.EdgeMatchingMetric       = (eEdgeMatchingMetric)info.GetValue("EdgeMatchingMetric", typeof(eEdgeMatchingMetric));
                globalSettings.MaxStepHeight            = info.GetSingle("MaxStepHeight");
                globalSettings.MaxSeparation            = info.GetSingle("MaxSeparation");
                globalSettings.MaxOverhang            = info.GetSingle("MaxOverhang");
                globalSettings.PlanarAlignmentAngle   = info.GetSingle("PlanarAlignmentAngle");
                globalSettings.VerticalAlignmentAngle = info.GetSingle("VerticalAlignmentAngle");
                globalSettings.MinEdgeOverlap         = info.GetSingle("MinEdgeOverlap");

                // Nav Mesh Simplification Settings
                globalSettings.EnableSimplification         = info.GetBoolean("EnableSimplification");
                globalSettings.MaxBorderSimplifyArea        = info.GetSingle("MaxBorderSimplifyArea");
                globalSettings.MaxConcaveBorderSimplifyArea = info.GetSingle("MaxConcaveBorderSimplifyArea");
                globalSettings.UseHeightPartitioning        = info.GetBoolean("UseHeightPartitioning");
                globalSettings.MaxPartitionHeightError      = info.GetSingle("MaxPartitionHeightError");

                // Nav Mesh Simplification Settings (Advanced)
                globalSettings.MinCorridorWidth                  = info.GetSingle("MinCorridorWidth");
                globalSettings.MaxCorridorWidth                  = info.GetSingle("MaxCorridorWidth");
                globalSettings.HoleReplacementArea               = info.GetSingle("HoleReplacementArea");
                globalSettings.MaxLoopShrinkFraction             = info.GetSingle("MaxLoopShrinkFraction");
                globalSettings.MaxBorderHeightError              = info.GetSingle("MaxBorderHeightError");
                globalSettings.MaxBorderDistanceError            = info.GetSingle("MaxBorderDistanceError");
                globalSettings.MaxPartitionSize                  = info.GetInt32("MaxPartitionSize");
                globalSettings.UseConservativeHeightPartitioning = info.GetBoolean("UseConservativeHeightPartitioning");
                globalSettings.HertelMehlhornHeightError         = info.GetSingle("HertelMehlhornHeightError");
                globalSettings.PlanarityThreshold                = info.GetSingle("PlanarityThreshold");
                globalSettings.NonconvexityThreshold             = info.GetSingle("NonconvexityThreshold");
                globalSettings.BoundaryEdgeFilterThreshold       = info.GetSingle("BoundaryEdgeFilterThreshold");
                globalSettings.MaxSharedVertexHorizontalError    = info.GetSingle("MaxSharedVertexHorizontalError");
                globalSettings.MaxSharedVertexVerticalError      = info.GetSingle("MaxSharedVertexVerticalError");
                globalSettings.MaxBoundaryVertexHorizontalError  = info.GetSingle("MaxBoundaryVertexHorizontalError");
                globalSettings.MaxBoundaryVertexVerticalError    = info.GetSingle("MaxBoundaryVertexVerticalError");
                globalSettings.MergeLongestEdgesFirst            = info.GetBoolean("MergeLongestEdgesFirst");

                // Nav Mesh Split Generation Settings
                if (SerializationHelper.HasElement(info, "NumTilesX"))
                {
                    globalSettings.NumTilesX = info.GetInt32("NumTilesX");
                }
                if (SerializationHelper.HasElement(info, "NumTilesY"))
                {
                    globalSettings.NumTilesY = info.GetInt32("NumTilesY");
                }
                if (SerializationHelper.HasElement(info, "SplitGenerationMethod"))
                {
                    globalSettings.SplitGenerationMethod = (eSplitGenerationMethod)info.GetValue("SplitGenerationMethod", typeof(eSplitGenerationMethod));
                }
                if (SerializationHelper.HasElement(info, "ShelverType"))
                {
                    globalSettings.ShelverType = (eShelverType)info.GetValue("ShelverType", typeof(eShelverType));
                }

                // Nav Mesh Link Settings
                if (SerializationHelper.HasElement(info, "LinkEdgeMatchTolerance"))
                {
                    globalSettings.LinkEdgeMatchTolerance = info.GetSingle("LinkEdgeMatchTolerance");
                }

                if (SerializationHelper.HasElement(info, "LinkMaxStepHeight"))
                {
                    globalSettings.LinkMaxStepHeight = info.GetSingle("LinkMaxStepHeight");
                }

                if (SerializationHelper.HasElement(info, "LinkMaxSeparation"))
                {
                    globalSettings.LinkMaxSeparation = info.GetSingle("LinkMaxSeparation");
                }

                if (SerializationHelper.HasElement(info, "LinkMaxOverhang"))
                {
                    globalSettings.LinkMaxOverhang = info.GetSingle("LinkMaxOverhang");
                }

                if (SerializationHelper.HasElement(info, "LinkPlanarAlignmentAngle"))
                {
                    globalSettings.LinkPlanarAlignmentAngle = info.GetSingle("LinkPlanarAlignmentAngle");
                }

                if (SerializationHelper.HasElement(info, "LinkVerticalAlignmentAngle"))
                {
                    globalSettings.LinkVerticalAlignmentAngle = info.GetSingle("LinkVerticalAlignmentAngle");
                }

                if (SerializationHelper.HasElement(info, "LinkMinEdgeOverlap"))
                {
                    globalSettings.LinkMinEdgeOverlap = info.GetSingle("LinkMinEdgeOverlap");
                }
            }
        }
 protected HeightmapCursorProperties(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _height = info.GetSingle("_height");
 }
        /// <summary>
        /// Called when deserializing
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected CubemapShape(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            _key   = info.GetString("_key");
            _iSize = info.GetInt32("_iSize");
            if (SerializationHelper.HasElement(info, "_bGenMipMaps"))
            {
                _bGenMipMaps = info.GetBoolean("_bGenMipMaps");
            }
            if (SerializationHelper.HasElement(info, "_iPasses"))
            {
                _iPasses = info.GetInt32("_iPasses");
            }
            if (SerializationHelper.HasElement(info, "_bContinuousUpdate"))
            {
                _bContinuousUpdate = info.GetBoolean("_bContinuousUpdate");
            }
            if (SerializationHelper.HasElement(info, "_iUpdateCount"))
            {
                _iUpdateCount = info.GetInt32("_iUpdateCount");
            }
            if (SerializationHelper.HasElement(info, "_fUpdateInterval"))
            {
                _fUpdateInterval = info.GetSingle("_fUpdateInterval");
            }
            if (SerializationHelper.HasElement(info, "_bAlternate"))
            {
                _bAlternate = info.GetBoolean("_bAlternate");
            }
            if (SerializationHelper.HasElement(info, "_fNearClip"))
            {
                _fNearClip = info.GetSingle("_fNearClip");
            }
            if (SerializationHelper.HasElement(info, "_fFarClip"))
            {
                _fFarClip = info.GetSingle("_fFarClip");
            }
            if (SerializationHelper.HasElement(info, "_iRenderFilterMask"))
            {
                _iRenderFilterMask = (FlagsInt32_e)info.GetValue("_iRenderFilterMask", typeof(FlagsInt32_e));
            }

            if (SerializationHelper.HasElement(info, "_bUpdateInEditor"))
            {
                _bUpdateInEditor = info.GetBoolean("_bUpdateInEditor");
            }
            if (SerializationHelper.HasElement(info, "_bSaveOnExport"))
            {
                _bSaveOnExport = info.GetBoolean("_bSaveOnExport");
            }

            if (SerializationHelper.HasElement(info, "_rendererConfig"))
            {
                _rendererConfig = info.GetString("_rendererConfig");
            }

            if (SerializationHelper.HasElement(info, "_eRenderingType"))
            {
                _eRenderingType = (EngineInstanceCubemapEntity.CubeMapRenderingType_e)info.GetValue("_eRenderingType", typeof(EngineInstanceCubemapEntity.CubeMapRenderingType_e));
            }

            if (SerializationHelper.HasElement(info, "_fSpecularPower"))
            {
                _fSpecularPower = (float)info.GetDouble("_fSpecularPower");
            }

            if (SerializationHelper.HasElement(info, "_bAlwaysVisible"))
            {
                _bAlwaysVisible = info.GetBoolean("_bAlwaysVisible");
            }

            AddHint(HintFlags_e.NoRotation);
            RemoveHint(HintFlags_e.NoScale);
        }
    public bool runTest()
    {
        Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
        int               iCountErrors    = 0;
        int               iCountTestcases = 0;
        String            strLoc          = "Loc_000oo";
        Hashtable         dic1;
        Int32             iNumberOfItems = 10;
        SerializationInfo ser1;

        Object[]  serKeys;
        Object[]  serValues;
        Hashtable hsh1;
        Hashtable hsh3;
        Hashtable hsh4;

        DictionaryEntry[] strValueArr;
        MemoryStream      ms1;

        try
        {
            do
            {
                strLoc = "Loc_8345vdfv";
                dic1   = new Hashtable();
                for (int i = 0; i < iNumberOfItems; i++)
                {
                    dic1.Add(i, "String_" + i);
                }
                ser1 = new SerializationInfo(typeof(Hashtable), new FormatterConverter());
                dic1.GetObjectData(ser1, new StreamingContext());
                iCountTestcases++;
                if (ser1.GetSingle("LoadFactor") != 0.72f)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_748cdg! Expected value not returned, " + ser1.GetSingle("LoadFactor"));
                }
                if (ser1.GetInt32("Version") != 11)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_01823csdf! Expected value not returned, " + ser1.GetSingle("Version"));
                }
                if (ser1.GetSingle("HashSize") != 23)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_7132fgfg! Expected value not returned, " + ser1.GetSingle("LoadFactor"));
                }
                serKeys   = (Object[])ser1.GetValue("Keys", typeof(Object[]));
                serValues = (Object[])ser1.GetValue("Values", typeof(Object[]));
                Array.Sort(serKeys);
                Array.Sort(serValues);
                for (int i = 0; i < iNumberOfItems; i++)
                {
                    if ((Int32)serKeys[i] != i)
                    {
                        iCountErrors++;
                        Console.WriteLine("Err_1nd342_" + i + "! Expected value not returned, " + i);
                    }
                    if (!((String)serValues[i]).Equals("String_" + i))
                    {
                        iCountErrors++;
                        Console.WriteLine("Err_7539fdg_" + i + "! Expected value not returned, " + i);
                    }
                }
                try
                {
                    iCountTestcases++;
                    dic1.GetObjectData(null, new StreamingContext());
                    iCountErrors++;
                    Console.WriteLine("Err_7439dg! Exception not thrown");
                }
                catch (ArgumentNullException)
                {
                }
                catch (Exception ex)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_6572fdg! Unexpected exception thrown, " + ex);
                }
                iCountTestcases++;
                hsh1 = new Hashtable();
                for (int i = 0; i < 10; i++)
                {
                    hsh1.Add("Key_" + i, "Value_" + i);
                }
                BinaryFormatter formatter = new BinaryFormatter();
                ms1 = new MemoryStream();
                formatter.Serialize(ms1, hsh1);
                ms1.Position = 0;
                hsh4         = (Hashtable)formatter.Deserialize(ms1);
                if (hsh4.Count != hsh1.Count)
                {
                    iCountErrors++;
                    Console.WriteLine("Err_072xsf! Expected value not returned, " + hsh4.Count);
                }
                strValueArr = new DictionaryEntry[hsh4.Count];
                hsh4.CopyTo(strValueArr, 0);
                hsh3 = new Hashtable();
                for (int i = 0; i < 10; i++)
                {
                    if (!hsh4.Contains("Key_" + i))
                    {
                        iCountErrors++;
                        Console.WriteLine("Err_742ds8f! Expected value not returned, " + hsh4.Contains("Key_" + i));
                    }
                    if (!hsh4.ContainsKey("Key_" + i))
                    {
                        iCountErrors++;
                        Console.WriteLine("Err_742389dsaf! Expected value not returned, " + hsh4.ContainsKey("Key_" + i));
                    }
                    if (!hsh4.ContainsValue("Value_" + i))
                    {
                        iCountErrors++;
                        Console.WriteLine("Err_0672esfs! Expected value not returned, " + hsh4.ContainsValue("Value_" + i));
                    }
                    if (!hsh1.ContainsValue(((DictionaryEntry)strValueArr[i]).Value))
                    {
                        iCountErrors++;
                        Console.WriteLine("Err_87429dsfd! Expected value not returned, " + ((DictionaryEntry)strValueArr[i]).Value);
                    }
                    try
                    {
                        hsh3.Add(((DictionaryEntry)strValueArr[i]).Value, null);
                    }
                    catch (Exception)
                    {
                        iCountErrors++;
                        Console.WriteLine("Err_74298dsd! Exception thrown for  " + ((DictionaryEntry)strValueArr[i]).Value);
                    }
                }
            } while (false);
        }
        catch (Exception exc_general)
        {
            ++iCountErrors;
            Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy!  strLoc==" + strLoc + ", exc_general==\n" + exc_general.ToString());
        }
        if (iCountErrors == 0)
        {
            Console.WriteLine("paSs.   " + s_strTFPath + " " + s_strTFName + " ,iCountTestcases==" + iCountTestcases);
            return(true);
        }
        else
        {
            Console.WriteLine("FAiL!   " + s_strTFPath + " " + s_strTFName + " ,iCountErrors==" + iCountErrors + " , BugNums?: " + s_strActiveBugNums);
            return(false);
        }
    }
Example #11
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="info">序列化信息</param>
 /// <param name="context">上下文</param>
 protected HXException(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     this.Code  = info.GetString("ExceptionCode");
     this.Level = (HXExceptionLevel)info.GetSingle("Level");
 }
        public virtual object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
        {
            Element element = (Element)obj;
            SerializationInfoEnumerator enumerator = info.GetEnumerator();

            //Reset reference properties
            element.ResetPath();

            //Enumerate the info object and apply to the appropriate properties
            while (enumerator.MoveNext())
            {
                if (enumerator.Name == "Key")
                {
                    element.SetKey(info.GetString("Key"));
                }
                else if (enumerator.Name == "Path")
                {
                    element.SetPath(Serialize.GetPath(info.GetString("Path")));
                }
                else if (enumerator.Name == "ZOrder")
                {
                    element.SetOrder(info.GetInt32("ZOrder"));
                }
                else if (enumerator.Name == "BorderColor")
                {
                    element.BorderColor = Color.FromArgb(Convert.ToInt32(info.GetString("BorderColor")));
                }
                else if (enumerator.Name == "BorderStyle")
                {
                    element.BorderStyle = (DashStyle)Enum.Parse(typeof(DashStyle), info.GetString("BorderStyle"));
                }
                else if (enumerator.Name == "BorderWidth")
                {
                    element.BorderWidth = info.GetSingle("BorderWidth");
                }
                else if (enumerator.Name == "DrawShadow")
                {
                    element.DrawShadow = info.GetBoolean("DrawShadow");
                }
                else if (enumerator.Name == "SmoothingMode")
                {
                    element.SmoothingMode = (SmoothingMode)Enum.Parse(typeof(SmoothingMode), info.GetString("SmoothingMode"));
                }
                else if (enumerator.Name == "Opacity")
                {
                    element.Opacity = info.GetByte("Opacity");
                }
                else if (enumerator.Name == "Tooltip")
                {
                    element.Tooltip = info.GetString("Tooltip");
                }
                else if (enumerator.Name == "Visible")
                {
                    element.Visible = info.GetBoolean("Visible");
                }
                else if (enumerator.Name == "Tag")
                {
                    element.Tag = info.GetValue("Tag", typeof(object));
                }
            }

            return(element);
        }
Example #13
0
 protected PositionState(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this.position.x = info.GetSingle("x");
     this.position.y = info.GetSingle("y");
 }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Vector3D"/> class with serialized data.
 /// </summary>
 /// <param name="info">The object that holds the serialized object data.</param>
 /// <param name="context">The contextual information about the source or destination.</param>
 private Vector3D(SerializationInfo info, StreamingContext context)
 {
     _x = info.GetSingle("X");
     _y = info.GetSingle("Y");
     _z = info.GetSingle("Z");
 }
Example #15
0
 protected Route(SerializationInfo info, StreamingContext context)
     : this(false,
            info?.GetValue <ValueT[]>(nameof(nodes)),
            info?.GetSingle(nameof(Cost)) ?? throw new ArgumentNullException(nameof(info)))
 {
 }
 public DummyClassB(SerializationInfo info, StreamingContext context)
 {
     Id    = info.GetSingle(nameof(Id));
     Other = info.GetValue(nameof(Other), typeof(DummyClassC)) as DummyClassC;
     Text  = info.GetValue(nameof(Text), typeof(string)) as string;
 }
Example #17
0
 protected CoordinateF(SerializationInfo info, StreamingContext context)
 {
     X = info.GetSingle("X");
     Y = info.GetSingle("Y");
     Z = info.GetSingle("Z");
 }
Example #18
0
 public DummyClassA(SerializationInfo info, StreamingContext context)
 {
     Id    = info.GetSingle(nameof(Id));
     Other = info.GetValue(nameof(Other), typeof(DummyClassB)) as DummyClassB;
 }
 public CornerData(SerializationInfo info, StreamingContext context)
 {
     Offset   = info.GetSingle("Offset");
     DeltaPos = (Vector3)info.GetValue("DeltaPos", typeof(Vector3));
 }
Example #20
0
	public bool runTest()
	{
		Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
		int iCountErrors = 0;
		int iCountTestcases = 0;
		String strLoc = "Loc_000oo";
		SerializationInfo serinfo1 = null;
		Boolean fValue;
		Char chValue;
		SByte sbtValue;
		Byte btValue;
		Int16 i16Value;
		Int32 i32Value;
		Int64 i64Value;
		UInt16 ui16Value;
		UInt32 ui32Value;
		UInt64 ui64Value;
		Double dblValue;
		Single sglValue;
		DateTime dtValue;
		Decimal dcmValue;
		StringBuilder sbldr1;
		String strValue;
		Random rnd1;
		try {
			do
			{
				strLoc="Loc_6573cd";
				serinfo1 = new SerializationInfo(typeof(Int32), new FormatterConverter());
				iCountTestcases++;
				if(serinfo1.MemberCount != 0)
				{
					iCountErrors++;
					Console.WriteLine("Err_0246sd! Wrong number of members, " + serinfo1.MemberCount.ToString());
				}
				strLoc="Loc_6853vd";
				fValue = false;
				serinfo1.AddValue("Boolean_1", fValue);
				iCountTestcases++;
				if(serinfo1.GetBoolean("Boolean_1") != fValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_0945csd! wrong value returned, " + serinfo1.GetBoolean("Boolean_1"));
				}
				fValue = true;
				serinfo1.AddValue("Boolean_2", fValue);
				iCountTestcases++;
				if(serinfo1.GetBoolean("Boolean_2") != fValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_6753vd! wrong value returned, " + serinfo1.GetBoolean("Boolean_2"));
				}
				try {
					iCountTestcases++;
					serinfo1.AddValue("Boolean_2", fValue);
					iCountErrors++;
					Console.WriteLine("Err_1065753cd! Exception not thrown");
					}catch(SerializationException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_5739cd! Wrong exception thrown, " + ex);
				}
				Console.WriteLine("Large String, ticks, " + Environment.TickCount);
				sbldr1 = new StringBuilder("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
				fValue = false;
				serinfo1.AddValue(sbldr1.ToString(), fValue);
				iCountTestcases++;
				if(serinfo1.GetBoolean(sbldr1.ToString()) != fValue)
				{
					iCountErrors++;
					Console.WriteLine("Err_6538fvd! wrong value returned, " + serinfo1.GetBoolean(sbldr1.ToString()));
				}
				try {
					iCountTestcases++;
					serinfo1.AddValue(null, fValue);
					iCountErrors++;
					Console.WriteLine("Err_0156ds! Exception not thrown");
					}catch(ArgumentNullException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_57834fd! Wrong exception thrown, " + ex);
				}
				Console.WriteLine("Char ticks, " + Environment.TickCount);
				rnd1 = new Random();
				for(int i=0; i<50; i++) {
					strLoc="Loc_6753cd_" + i;
					chValue = (Char)(65536 * rnd1.NextDouble());
					strValue = "Char_" + i;
					serinfo1.AddValue(strValue, chValue);
					iCountTestcases++;
					if(serinfo1.GetChar(strValue)!= chValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_65730dsw_" + i + "! Wrong Char returned, " + serinfo1.GetChar(strValue));
					}
				}
				try {
					iCountTestcases++;
					serinfo1.AddValue("Char_1", 'a');
					iCountErrors++;
					Console.WriteLine("Err_643cd! Exception not thrown");
					}catch(SerializationException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_02457fd! Wrong exception thrown, " + ex);
				}
				try {
					iCountTestcases++;
					serinfo1.AddValue("Boolean_1", 'a');
					iCountErrors++;
					Console.WriteLine("Err_5732fcd! Exception not thrown");
					}catch(SerializationException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_024568fd! Wrong exception thrown, " + ex);
				}
				Console.WriteLine("SByte ticks, " + Environment.TickCount);
				for(int i=(int)SByte.MinValue; i<(int)SByte.MaxValue; i++) {
					strLoc="Loc_56473vd_" + i;
					sbtValue = (SByte)i;;
					strValue = "SByte_" + i;
					serinfo1.AddValue(strValue, sbtValue);
					iCountTestcases++;
					if(serinfo1.GetSByte(strValue)!= sbtValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_4627fds_" + i + "! Wrong Sbyte returned, " + serinfo1.GetSByte(strValue));
					}
				}
				Console.WriteLine("Byte ticks, " + Environment.TickCount);
				for(int i=(int)Byte.MinValue; i<(int)Byte.MaxValue; i++) {
					strLoc="Loc_01192ds_" + i;
					btValue = (Byte)i;;
					strValue = "Byte_" + i;
					serinfo1.AddValue(strValue, btValue);
					iCountTestcases++;
					if(serinfo1.GetByte(strValue)!= btValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_0267fe_" + i + "! Wrong byte returned, " + serinfo1.GetByte(strValue));
					}
				}
				Console.WriteLine("Int16 ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_012965565ds_" + i;
					i16Value = (short)((int)Int16.MaxValue * rnd1.NextDouble());
					if(rnd1.NextDouble()<0.5)
					i16Value = (short)(-1 * i16Value);
					strValue = "Int16_" + i;
					serinfo1.AddValue(strValue, i16Value);
					iCountTestcases++;
					if(serinfo1.GetInt16(strValue)!= i16Value)
					{
						iCountErrors++;
						Console.WriteLine("Err_0267fe_" + i + "! Wrong value returned, " + serinfo1.GetInt16(strValue));
					}
				}
				Console.WriteLine("Int32 ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_015643ds_" + i;
					i32Value = (int)(Int32.MaxValue * rnd1.NextDouble());
					if(rnd1.NextDouble()<0.5)
					i32Value = (-1 * i32Value);
					strValue = "Int32_" + i;
					serinfo1.AddValue(strValue, i32Value);
					iCountTestcases++;
					if(serinfo1.GetInt32(strValue)!= i32Value)
					{
						iCountErrors++;
						Console.WriteLine("Err_5427ds_" + i + "! Wrong value returned, " + serinfo1.GetInt32(strValue));
					}
				}
				Console.WriteLine("Int64 ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_625bfg_" + i;
					i64Value = (long)((long)Int64.MaxValue * rnd1.NextDouble());
					if(rnd1.NextDouble()<0.5)
					i64Value = (long)(-1 * i64Value);
					strValue = "Int64_" + i;
					serinfo1.AddValue(strValue, i64Value);
					iCountTestcases++;
					if(serinfo1.GetInt64(strValue)!= i64Value)
					{
						iCountErrors++;
						Console.WriteLine("Err_6427dc_" + i + "! Wrong value returned, " + serinfo1.GetInt64(strValue));
					}
				}
				Console.WriteLine("UInt16 ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_6473cd_" + i;
					ui16Value = (ushort)((int)UInt16.MaxValue * rnd1.NextDouble());
					strValue = "UInt16_" + i;
					serinfo1.AddValue(strValue, ui16Value);
					iCountTestcases++;
					if(serinfo1.GetUInt16(strValue)!= ui16Value)
					{
						iCountErrors++;
						Console.WriteLine("Err_748vd_" + i + "! Wrong value returned, " + serinfo1.GetUInt16(strValue));
					}
				}
				Console.WriteLine("UInt32 ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_7573cd_" + i;
					ui32Value = (uint)(UInt32.MaxValue * rnd1.NextDouble());
					strValue = "UInt32_" + i;
					serinfo1.AddValue(strValue, ui32Value);
					iCountTestcases++;
					if(serinfo1.GetUInt32(strValue)!= ui32Value)
					{
						iCountErrors++;
						Console.WriteLine("Err_4738cd_" + i + "! Wrong value returned, " + serinfo1.GetUInt32(strValue));
					}
				}
				Console.WriteLine("UInt64 ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_63dc_" + i;
					ui64Value = (ulong)(UInt64.MaxValue * rnd1.NextDouble());
					strValue = "UInt64_" + i;
					serinfo1.AddValue(strValue, ui64Value);
					iCountTestcases++;
					if(serinfo1.GetUInt64(strValue)!= ui64Value)
					{
						iCountErrors++;
						Console.WriteLine("Err_6583fd_" + i + "! Wrong value returned, " + serinfo1.GetUInt64(strValue));
					}
				}
				Console.WriteLine("Double ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_7539cd_" + i;
					dblValue = Double.MaxValue * rnd1.NextDouble();
					if(rnd1.NextDouble()<0.5)
					dblValue = (-1 * dblValue);
					strValue = "Double_" + i;
					serinfo1.AddValue(strValue, dblValue);
					iCountTestcases++;
					if(serinfo1.GetDouble(strValue)!= dblValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_653cfd_" + i + "! Wrong value returned, " + serinfo1.GetDouble(strValue));
					}
				}
				Console.WriteLine("Single ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_0247fd_" + i;
					sglValue = (float)(Single.MaxValue * rnd1.NextDouble());
					if(rnd1.NextDouble()<0.5)
					sglValue = (-1 * sglValue);
					strValue = "Single_" + i;
					serinfo1.AddValue(strValue, sglValue);
					iCountTestcases++;
					if(serinfo1.GetSingle(strValue)!= sglValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_0468fd_" + i + "! Wrong value returned, " + serinfo1.GetSingle(strValue));
					}
				}
				strValue = "This is a String";
				serinfo1.AddValue("String_1", strValue);
				iCountTestcases++;
				if(!serinfo1.GetString("String_1").Equals(strValue))
				{
					iCountErrors++;
					Console.WriteLine("Err_0945csd! wrong value returned, " + serinfo1.GetString("String_1"));
				}
				strValue = "";
				serinfo1.AddValue("String_2", strValue);
				iCountTestcases++;
				if(!serinfo1.GetString("String_2").Equals(String.Empty))
				{
					iCountErrors++;
					Console.WriteLine("Err_0945csd! wrong value returned, " + serinfo1.GetString("String_2"));
				}
				strValue = null;
				serinfo1.AddValue("String_3", strValue);
				iCountTestcases++;
				if(serinfo1.GetString("String_3") != null)
				{
					iCountErrors++;
					Console.WriteLine("Err_0945csd! wrong value returned, " + serinfo1.GetString("String_3"));
				}
				try {
					iCountTestcases++;
					serinfo1.AddValue("String_2", fValue);
					iCountErrors++;
					Console.WriteLine("Err_1065753cd! Exception not thrown");
					}catch(SerializationException){
					}catch(Exception ex){
					iCountErrors++;
					Console.WriteLine("Err_5739cd! Wrong exception thrown, " + ex);
				}
				Console.WriteLine("Single ticks, " + Environment.TickCount);
				for(int i=0; i<50; i++) {
					strLoc="Loc_0247fd_" + i;
					dblValue = (double)(DateTime.MaxValue.ToOADate() * rnd1.NextDouble());
					strValue = "DateTime_" + i;
					dtValue = DateTime.FromOADate(dblValue);
					serinfo1.AddValue(strValue, dtValue);
					iCountTestcases++;
					if(serinfo1.GetDateTime(strValue)!= dtValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_0468fd_" + i + "! Wrong value returned, " + serinfo1.GetDateTime(strValue));
					}
				}
				for(int i=0; i<50; i++) {
					strLoc="Loc_0247fd_" + i;
					dcmValue = (Decimal)((double)Decimal.MaxValue * rnd1.NextDouble());
					if(rnd1.NextDouble()<0.5)
						dcmValue = (Decimal)(-1 * dcmValue);
					strValue = "Decimal_" + i;
					serinfo1.AddValue(strValue, dcmValue);
					iCountTestcases++;
					if(serinfo1.GetDecimal(strValue)!= dcmValue)
					{
						iCountErrors++;
						Console.WriteLine("Err_2342fdsg_" + i + "! Wrong value returned, " + serinfo1.GetDecimal(strValue));
					}
				}
			} while (false);
			} catch (Exception exc_general ) {
			++iCountErrors;
			Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general==\n"+exc_general.StackTrace);
		}
		if ( iCountErrors == 0 )
		{
			Console.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases.ToString());
			return true;
		}
		else
		{
			Console.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors.ToString()+" , BugNums?: "+s_strActiveBugNums );
			return false;
		}
	}
Example #21
0
 // Deserialize
 public Vector3(SerializationInfo info, StreamingContext context)
 {
     X = info.GetSingle("x");
     Y = info.GetSingle("y");
     Z = info.GetSingle("z");
 }
Example #22
0
 public Vector(SerializationInfo info, StreamingContext context)
 {
     X = info.GetSingle("X");
     Y = info.GetSingle("Y");
 }
Example #23
0
 protected Vector2Value(SerializationInfo info, StreamingContext context)
 {
     value = new Vector2(info.GetSingle("x"), info.GetSingle("y"));
 }
 DecorationModelResource(SerializationInfo info, StreamingContext context)
 {
     _Name     = info.GetString("_Name");
     _Filename = info.GetString("_Filename");
     ID        = info.GetInt32("ID");
     if (SerializationHelper.HasElement(info, "_NearClipDistance"))
     {
         _NearClipDistance = info.GetSingle("_NearClipDistance");
     }
     if (SerializationHelper.HasElement(info, "_FarClipDistance"))
     {
         _FarClipDistance = info.GetSingle("_FarClipDistance");
     }
     if (SerializationHelper.HasElement(info, "_fRelFadeStart"))
     {
         _fRelFadeStart = info.GetSingle("_fRelFadeStart");
     }
     if (SerializationHelper.HasElement(info, "_visibleBitmask"))
     {
         _visibleBitmask = (FlagsInt32_e)info.GetValue("_visibleBitmask", typeof(FlagsInt32_e));
     }
     if (SerializationHelper.HasElement(info, "_alignment"))
     {
         _alignment = (TerrainAlignment)info.GetValue("_alignment", typeof(TerrainAlignment));
     }
     if (SerializationHelper.HasElement(info, "_sizeVariation"))
     {
         _sizeVariation = info.GetSingle("_sizeVariation");
     }
     if (SerializationHelper.HasElement(info, "_averageScale"))
     {
         _averageScale = info.GetSingle("_averageScale");
     }
     if (SerializationHelper.HasElement(info, "_density"))
     {
         _density = info.GetSingle("_density");
     }
     if (SerializationHelper.HasElement(info, "_randomness"))
     {
         _randomness = info.GetSingle("_randomness");
     }
     if (SerializationHelper.HasElement(info, "_pivotHeight"))
     {
         _pivotHeight = info.GetSingle("_pivotHeight");
     }
     if (SerializationHelper.HasElement(info, "_customLightmapCasterMesh"))
     {
         _customLightmapCasterMesh = info.GetString("_customLightmapCasterMesh");
     }
     if (SerializationHelper.HasElement(info, "_applyWind"))
     {
         _applyWind = info.GetSingle("_applyWind");
     }
     if (SerializationHelper.HasElement(info, "_applyConstraint"))
     {
         _applyConstraint = info.GetSingle("_applyConstraint");
     }
     if (SerializationHelper.HasElement(info, "_collisionCapsuleRadius"))
     {
         _collisionCapsuleRadius = info.GetSingle("_collisionCapsuleRadius");
     }
     if (SerializationHelper.HasElement(info, "_castLightmapShadows"))
     {
         _castLightmapShadows = info.GetBoolean("_castLightmapShadows");
     }
     if (SerializationHelper.HasElement(info, "_castDynamicShadows"))
     {
         _castDynamicShadows = info.GetBoolean("_castDynamicShadows");
     }
     if (SerializationHelper.HasElement(info, "_ExportFilename"))
     {
         _ExportFilename = info.GetString("_ExportFilename");
     }
     if (SerializationHelper.HasElement(info, "_iSectorX1"))
     {
         _iSectorX1 = info.GetInt32("_iSectorX1");
         _iSectorY1 = info.GetInt32("_iSectorY1");
         _iSectorX2 = info.GetInt32("_iSectorX2");
         _iSectorY2 = info.GetInt32("_iSectorY2");
     }
     if (SerializationHelper.HasElement(info, "_LODOrigin"))
     {
         _LODOrigin = (DecorationModelResource)info.GetValue("_LODOrigin", typeof(DecorationModelResource));
     }
 }
Example #25
0
 /// <summary>
 /// Serialization constructor for link ports.
 /// </summary>
 /// <param name="info">Serialization state information</param>
 /// <param name="context">Streaming context information</param>
 protected LinkPort(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this.radius = info.GetSingle("Radius");
 }
Example #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Plane"/> class with serialized data.
 /// </summary>
 /// <param name="info">The object that holds the serialized object data.</param>
 /// <param name="context">The contextual information about the source or destination.</param>
 private Plane(SerializationInfo info, StreamingContext context)
 {
     _normal = (Vector3)info.GetValue("Normal", typeof(Vector3));
     _const  = info.GetSingle("Constant");
 }
 /// <summary>
 /// Called when deserializing
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected LightGridIndicatorShape(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     _fDisplayRadius = info.GetSingle("_fDisplayRadius");
     _bRenderGrid    = info.GetBoolean("_bRenderGrid");
     AddHint(HintFlags_e.NoRotation | HintFlags_e.NoScale);
 }
Example #28
0
 public Timer(SerializationInfo info, StreamingContext context)
 {
     value  = info.GetSingle("value");
     max    = info.GetSingle("max");
     paused = info.GetBoolean("paused");
 }
 protected HeightmapCursorProperties(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     _height = info.GetSingle("_height");
 }
Example #30
0
        /// <summary>
        /// Called when deserializing
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected MirrorShape(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            _fSizeX   = info.GetSingle("_fSizeX");
            _fSizeY   = info.GetSingle("_fSizeY");
            _shaderFX = (ShaderEffectConfig)info.GetValue("_shaderFX", typeof(ShaderEffectConfig));
            _shaderFX.OnShaderEffectChanged += new CSharpFramework.Scene.ShaderEffectConfig.ShaderEffectChangedEventHandler(_shaderFX_OnShaderEffectChanged);
            _shaderFX.Owner = this;

            if (SerializationHelper.HasElement(info, "_iResolution"))
            {
                _iResolution = info.GetInt32("_iResolution");
            }
            if (SerializationHelper.HasElement(info, "_modelFile"))
            {
                _modelFile = info.GetString("_modelFile");
            }
            if (SerializationHelper.HasElement(info, "_farClipDist"))
            {
                _farClipDist = info.GetSingle("_farClipDist");
            }
            if (SerializationHelper.HasElement(info, "_iContextBitmask"))
            {
                _iContextBitmask = (FlagsInt32_e)info.GetValue("_iContextBitmask", typeof(FlagsInt32_e));
            }
            if (SerializationHelper.HasElement(info, "_reflectionShaderMode"))
            {
                _reflectionShaderMode = (ReflectionShaderMode)info.GetValue("_reflectionShaderMode", typeof(ReflectionShaderMode));
            }
            if (SerializationHelper.HasElement(info, "_bRenderExtObj"))
            {
                _bRenderExtObj = info.GetBoolean("_bRenderExtObj");
            }
            if (SerializationHelper.HasElement(info, "_fFovScale"))
            {
                _fFovScale = info.GetSingle("_fFovScale");
            }
            if (SerializationHelper.HasElement(info, "_fObliqueClippingPlaneOffset"))
            {
                _fObliqueClippingPlaneOffset = info.GetSingle("_fObliqueClippingPlaneOffset");
            }
            if (SerializationHelper.HasElement(info, "_bLODFromRefContext"))
            {
                _bLODFromRefContext = info.GetBoolean("_bLODFromRefContext");
            }
            if (SerializationHelper.HasElement(info, "_bUseHDR"))
            {
                _bUseHDR = info.GetBoolean("_bUseHDR");
            }

            if (SerializationHelper.HasElement(info, "_renderHook3"))
            {
                _renderHook = (RenderOrderBits_e)info.GetValue("_renderHook3", typeof(RenderOrderBits_e));
            }
            else if (SerializationHelper.HasElement(info, "_renderHook2"))
            {
                RenderOrderBits_e eRH;
                eRH = (RenderOrderBits_e)info.GetValue("_renderHook2", typeof(RenderOrderBits_e));

                // toggle VRH_ADDITIVE_PARTICLES with VRH_TRANSLUCENT_VOLUMES so that the VRenderHook_e enum order matches the execution order
                if (eRH == RenderOrderBits_e.AdditiveParticles)
                {
                    _renderHook = RenderOrderBits_e.TranslucentVolumes;
                }
                else if (eRH == RenderOrderBits_e.TranslucentVolumes)
                {
                    _renderHook = RenderOrderBits_e.AdditiveParticles;
                }
                else
                {
                    _renderHook = eRH;
                }
            }
            else if (SerializationHelper.HasElement(info, "_renderHook"))
            {
                int oldValue = info.GetInt32("_renderHook");
                _renderHook = ConversionUtils.UpdateRenderOrderBits(oldValue);
            }

            // backwards compatibility
            if (!SerializationHelper.HasElement(info, "SupportScaling"))
            {
                SetScaling_Internal(1.0f, 1.0f, 1.0f);
            }

            if (LinkTargets.Count == 0) // old version
            {
                this.CreateAllLinks();
            }
        }
 protected ElementRefGroup(SerializationInfo info, StreamingContext context)
 {
     Id       = info.GetSingle("Id");
     Elements = (IElementGroup <TItem>)info.GetValue("elements", typeof(IElementGroup <TItem>));
 }
        protected HavokNavMeshLocalSettingsShape(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            _vBoxSize = (Vector3F)info.GetValue("_vBoxSize", typeof(Vector3F));

            // Nav Mesh Generation Settings
            m_maxWalkableSlopeDeg = info.GetSingle("MaxWalkableSlope");

            // Nav Mesh Edge Matching Settings
            m_maxStepHeight             = info.GetSingle("MaxStepHeight");
            m_maxSeparation             = info.GetSingle("MaxSeparation");
            m_maxOverhang               = info.GetSingle("MaxOverhang");
            m_planarAlignmentAngleDeg   = info.GetSingle("PlanarAlignmentAngle");
            m_verticalAlignmentAngleDeg = info.GetSingle("VerticalAlignmentAngle");
            m_minEdgeOverlap            = info.GetSingle("MinEdgeOverlap");

            // Nav Mesh Simplification Settings
            m_maxBorderSimplifyArea        = info.GetSingle("MaxBorderSimplifyArea");
            m_maxConcaveBorderSimplifyArea = info.GetSingle("MaxConcaveBorderSimplifyArea");
            m_useHeightPartitioning        = info.GetBoolean("UseHeightPartitioning");
            m_maxPartitionHeightError      = info.GetSingle("MaxPartitionHeightError");

            // Nav Mesh Simplification Settings (Advanced)
            m_minCorridorWidth                  = info.GetSingle("MinCorridorWidth");
            m_maxCorridorWidth                  = info.GetSingle("MaxCorridorWidth");
            m_holeReplacementArea               = info.GetSingle("HoleReplacementArea");
            m_maxLoopShrinkFraction             = info.GetSingle("MaxLoopShrinkFraction");
            m_maxBorderHeightError              = info.GetSingle("MaxBorderHeightError");
            m_maxBorderDistanceError            = info.GetSingle("MaxBorderDistanceError");
            m_maxPartitionSize                  = info.GetInt32("MaxPartitionSize");
            m_useConservativeHeightPartitioning = info.GetBoolean("UseConservativeHeightPartitioning");
            m_hertelMehlhornHeightError         = info.GetSingle("HertelMehlhornHeightError");
            m_planarityThresholdDeg             = info.GetSingle("PlanarityThreshold");
            m_nonconvexityThreshold             = info.GetSingle("NonconvexityThreshold");
            m_boundaryEdgeFilterThreshold       = info.GetSingle("BoundaryEdgeFilterThreshold");
            m_maxSharedVertexHorizontalError    = info.GetSingle("MaxSharedVertexHorizontalError");
            m_maxSharedVertexVerticalError      = info.GetSingle("MaxSharedVertexVerticalError");
            m_maxBoundaryVertexHorizontalError  = info.GetSingle("MaxBoundaryVertexHorizontalError");
            m_maxBoundaryVertexVerticalError    = info.GetSingle("MaxBoundaryVertexVerticalError");
            m_mergeLongestEdgesFirst            = info.GetBoolean("MergeLongestEdgesFirst");
        }
 public bool runTest()
 {
     Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver : " + s_strDtTmVer);
     int iCountErrors = 0;
     int iCountTestcases = 0;
     String strLoc = "Loc_000oo";
     Hashtable dic1;
     Int32 iNumberOfItems = 10;
     SerializationInfo ser1;
     Object[] serKeys;
     Object[] serValues;
     Hashtable hsh1;
     Hashtable hsh3;
     Hashtable hsh4;
     DictionaryEntry[] strValueArr;
     MemoryStream ms1;
     try 
     {
         do
         {
             strLoc = "Loc_8345vdfv";
             dic1 = new Hashtable();
             for(int i=0; i<iNumberOfItems; i++)
             {
                 dic1.Add(i, "String_" + i);
             }
             ser1 = new SerializationInfo(typeof(Hashtable), new FormatterConverter());
             dic1.GetObjectData(ser1, new StreamingContext());
             iCountTestcases++;
             if(ser1.GetSingle("LoadFactor") != 0.72f) 
             {
                 iCountErrors++;
                 Console.WriteLine("Err_748cdg! Expected value not returned, " + ser1.GetSingle("LoadFactor"));
             }
             if(ser1.GetInt32("Version") != 11) 
             {
                 iCountErrors++;
                 Console.WriteLine("Err_01823csdf! Expected value not returned, " + ser1.GetSingle("Version"));
             }
             if(ser1.GetSingle("HashSize") != 23) 
             {
                 iCountErrors++;
                 Console.WriteLine("Err_7132fgfg! Expected value not returned, " + ser1.GetSingle("LoadFactor"));
             }
             serKeys = (Object[])ser1.GetValue("Keys", typeof(Object[]));
                 serValues = (Object[])ser1.GetValue("Values", typeof(Object[]));
                     Array.Sort(serKeys);
             Array.Sort(serValues);
             for(int i=0; i<iNumberOfItems; i++)
             {
                 if((Int32)serKeys[i] != i) 
                 {
                     iCountErrors++;
                     Console.WriteLine("Err_1nd342_" + i + "! Expected value not returned, " + i);
                 }
                 if(!((String)serValues[i]).Equals("String_" + i)) 
                 {
                     iCountErrors++;
                     Console.WriteLine("Err_7539fdg_" + i + "! Expected value not returned, " + i);
                 }
             }
             try
             {
                 iCountTestcases++;
                 dic1.GetObjectData(null, new StreamingContext());
                 iCountErrors++;
                 Console.WriteLine("Err_7439dg! Exception not thrown");
             }
             catch(ArgumentNullException)
             {
             }
             catch(Exception ex)
             {
                 iCountErrors++;
                 Console.WriteLine("Err_6572fdg! Unexpected exception thrown, " + ex);
             }
             iCountTestcases++;
             hsh1 = new Hashtable();
             for(int i=0; i<10; i++)
             {
                 hsh1.Add("Key_" + i, "Value_" + i);
             }
             BinaryFormatter formatter = new BinaryFormatter();
             ms1 = new MemoryStream();
             formatter.Serialize(ms1, hsh1);
             ms1.Position = 0;
             hsh4 = (Hashtable)formatter.Deserialize(ms1);
             if(hsh4.Count != hsh1.Count) 
             {
                 iCountErrors++;
                 Console.WriteLine("Err_072xsf! Expected value not returned, " + hsh4.Count);
             }				
             strValueArr = new DictionaryEntry[hsh4.Count];
             hsh4.CopyTo(strValueArr, 0);
             hsh3 = new Hashtable();
             for(int i=0; i<10; i++)
             {
                 if(!hsh4.Contains("Key_" + i)) 
                 {
                     iCountErrors++;
                     Console.WriteLine("Err_742ds8f! Expected value not returned, " + hsh4.Contains("Key_" + i));
                 }				
                 if(!hsh4.ContainsKey("Key_" + i)) 
                 {
                     iCountErrors++;
                     Console.WriteLine("Err_742389dsaf! Expected value not returned, " + hsh4.ContainsKey("Key_" + i));
                 }				
                 if(!hsh4.ContainsValue("Value_" + i)) 
                 {
                     iCountErrors++;
                     Console.WriteLine("Err_0672esfs! Expected value not returned, " + hsh4.ContainsValue("Value_" + i));
                 }				
                 if(!hsh1.ContainsValue(((DictionaryEntry)strValueArr[i]).Value)) 
                 {
                     iCountErrors++;
                     Console.WriteLine("Err_87429dsfd! Expected value not returned, " + ((DictionaryEntry)strValueArr[i]).Value);
                 }				
                 try
                 {
                     hsh3.Add(((DictionaryEntry)strValueArr[i]).Value, null);
                 }
                 catch(Exception)
                 {
                     iCountErrors++;
                     Console.WriteLine("Err_74298dsd! Exception thrown for  " + ((DictionaryEntry)strValueArr[i]).Value);
                 }
             }
         } while (false);
     } 
     catch (Exception exc_general ) 
     {
         ++iCountErrors;
         Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy!  strLoc=="+ strLoc +", exc_general==\n"+exc_general.ToString());
     }
     if ( iCountErrors == 0 )
     {
         Console.WriteLine( "paSs.   "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases);
         return true;
     }
     else
     {
         Console.WriteLine("FAiL!   "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums );
         return false;
     }
 }