示例#1
0
        public static void Serialize(KSoft.IO.XmlElementStream s, FA mode, BXmlSerializerInterface xsi,
                                     Collections.BTypeNames list, BListXmlParams @params, bool forceNoRootElementStreaming = false)
        {
            Contract.Requires(s != null);
            Contract.Requires(xsi != null);
            Contract.Requires(list != null);
            Contract.Requires(@params != null);

            if (forceNoRootElementStreaming)
            {
                @params.SetForceNoRootElementStreaming(true);
            }
            using (var xs =
#if NO_TLS_STREAMING
                       new BTypeNamesXmlSerializer(@params, list)
#else
                       BDatabaseXmlSerializerBase.sBTypeNamesXmlSerializer.Value.Reset(@params, list)
#endif
                   )
            {
                xs.StreamXml(s, mode, xsi);
            }
            if (forceNoRootElementStreaming)
            {
                @params.SetForceNoRootElementStreaming(false);
            }
        }
示例#2
0
        public BTypeNamesXmlSerializer(BListXmlParams @params, Collections.BTypeNames list)
        {
            Contract.Requires <ArgumentNullException>(@params != null);
            Contract.Requires <ArgumentNullException>(list != null);

            mParams = @params;
            mList   = list;
        }
        static string TryGetName(Collections.BTypeNames dbi, int id)
        {
            if (id >= 0 && id < dbi.Count)
            {
                return(dbi[id]);
            }

            return(null);
        }
示例#4
0
		public BGameData()
		{
			Resources = new Collections.BListAutoId<BResource>();
			Rates = new Collections.BTypeNames();
			Populations = new Collections.BTypeNames();
			RefCounts = new Collections.BTypeNames();
			#region Nonsense
			HUDItems = new Collections.BTypeNames();
			FlashableItems = new Collections.BTypeNames();
			UnitFlags = new Collections.BTypeNames();
			SquadFlags = new Collections.BTypeNames();
			#endregion
			CodeProtoObjects = new Collections.BTypeValuesString(kCodeProtoObjectsParams);
			CodeObjectTypes = new Collections.BTypeValuesString(kCodeObjectTypesParams);

			InfectionMap = new Collections.BListArray<BInfectionMap>();

			PlayerStates = new Collections.BTypeNames();
		}
示例#5
0
        public static void Serialize <TDoc, TCursor>(IO.TagElementStream <TDoc, TCursor, string> s,
                                                     Collections.BTypeNames list, BListXmlParams @params, bool forceNoRootElementStreaming = false)
            where TDoc : class
            where TCursor : class
        {
            Contract.Requires(s != null);
            Contract.Requires(list != null);
            Contract.Requires(@params != null);

            if (forceNoRootElementStreaming)
            {
                @params.SetForceNoRootElementStreaming(true);
            }
            using (var xs = new BTypeNamesXmlSerializer(@params, list))
            {
                xs.Serialize(s);
            }
            if (forceNoRootElementStreaming)
            {
                @params.SetForceNoRootElementStreaming(false);
            }
        }
 static string TryGetNameWithUndefined(Collections.BTypeNames dbi, int id)
 {
     return(dbi.UndefinedInterface.GetMemberNameOrUndefined(id));
 }
 static int TryGetIdWithUndefined(Collections.BTypeNames dbi, string name)
 {
     return(dbi.UndefinedInterface.GetMemberIdOrUndefined(name));
 }
 static int TryGetId(Collections.BTypeNames dbi, string name)
 {
     return(dbi.TryGetMemberId(name));
 }
示例#9
0
 protected override void FinishTlsStreaming()
 {
     mParams = null;
     mList   = null;
 }