当前位置: 首页>>代码示例>>C#>>正文


C# SerializationInfo.GetBoolean方法代码示例

本文整理汇总了C#中SerializationInfo.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# SerializationInfo.GetBoolean方法的具体用法?C# SerializationInfo.GetBoolean怎么用?C# SerializationInfo.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SerializationInfo的用法示例。


在下文中一共展示了SerializationInfo.GetBoolean方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SavedState

    //serialization constructor
    protected SavedState(SerializationInfo info,StreamingContext context)
    {
        try {
            this.position = (SerVector3)info.GetValue("position",typeof(SerVector3));
            this.rotation = (SerQuaternion)info.GetValue("rotation",typeof(SerQuaternion));
        } catch {
            //not available if used an older version to save the replay, ignore
        }
        this.localPosition = (SerVector3)info.GetValue("localPosition",typeof(SerVector3));
        this.localRotation = (SerQuaternion)info.GetValue("localRotation",typeof(SerQuaternion));

        emittingParticles = info.GetBoolean("emittingParticles");
        isActive = info.GetBoolean("isActive");
    }
开发者ID:ChubbRck,项目名称:SFB,代码行数:15,代码来源:SavedState.cs

示例2: AuthenticationInfo

 public AuthenticationInfo(SerializationInfo info, StreamingContext context)
 {
     IsAuthenticated = info.GetBoolean("IsAuthenticated");
     UserId = info.GetString("UserId");
     UserAlias = info.GetString("UserAlias");
     UserName = info.GetString("UserName");
     Token = info.GetString("Token");
     TokenSecret = info.GetString("TokenSecret");
 }
开发者ID:medvekoma,项目名称:portfotolio,代码行数:9,代码来源:AuthenticationInfo.cs

示例3: GlobalDefine

		protected GlobalDefine( SerializationInfo info, StreamingContext context )
		{
			define = info.GetString( "define" );
			enabled = info.GetBoolean( "enabled" );
		}
开发者ID:geechs-anakanishi,项目名称:P31UnityAddOns,代码行数:5,代码来源:GlobalDefinesWizard.cs

示例4: KRecord

		protected KRecord( SerializationInfo info, StreamingContext context )
		{
			int count = (int)info.GetValue( "ColumnCount", typeof( int ) );
			_Columns = new object[count];

			for( int i = 0; i < count; i++ ) {
				string type = info.GetString( "ColumnType" + i );
				object value = type == "VOID" ? null : info.GetValue( "ColumnValue" + i, Type.GetType( type ) );
				_Columns[i] = value;
			}

			_Sealed = info.GetBoolean( "RecordSealed" );

			_SerializeSchema = info.GetBoolean( "SerializeSchema" );
			if( _SerializeSchema ) _Schema = (KSchema)info.GetValue( "Schema", typeof( KSchema ) );
		}
开发者ID:olcayseker,项目名称:Kerosene,代码行数:16,代码来源:KRecord.cs

示例5: SavedState

    //serialization constructor
    protected SavedState(SerializationInfo info,StreamingContext context)
    {
        //this.position = (SerVector3)info.GetValue("position",typeof(SerVector3));
        this.localPosition = (SerVector3)info.GetValue("localPosition",typeof(SerVector3));
        //this.rotation = (SerQuaternion)info.GetValue("rotation",typeof(SerQuaternion));
        this.localRotation = (SerQuaternion)info.GetValue("localRotation",typeof(SerQuaternion));

        emittingParticles = info.GetBoolean("emittingParticles");
        isActive = info.GetBoolean("isActive");

        /**************************************************************
         *  New Addition
         **************************************************************/
        this.isMainCameraChild = info.GetBoolean("isMainCameraChild");
        this.tag = info.GetString("tag");
        this.convoTitle = info.GetString("convoTitle");
        this.dialogueNum = info.GetInt32("dialogueNum");
        this.dialogueType = info.GetString("dialogueType");
        //*************************************************************
    }
开发者ID:jiangkuo888,项目名称:ORP_beta,代码行数:21,代码来源:SavedState.cs

示例6: runTest

	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++;
//.........这里部分代码省略.........
开发者ID:ArildF,项目名称:masters,代码行数:101,代码来源:co3888get_most.cs

示例7: Object2PropertiesMapping

 //serialization constructor
 protected Object2PropertiesMapping(SerializationInfo info,StreamingContext context)
 {
     savedStates = (SerializableDictionary<int,SavedState>)info.GetValue("savedStates",typeof(SerializableDictionary<int,SavedState>));
     isParentObj = info.GetBoolean("isParentObj");
     parentMapping = (Object2PropertiesMapping)info.GetValue("parentMapping",typeof(Object2PropertiesMapping));
     childNo = info.GetInt32("childNo");
     prefabLoadPath = info.GetString("prefabLoadPath");
     lastChangedFrame = info.GetInt32("lastChangedFrame");
     firstChangedFrame = info.GetInt32("firstChangedFrame");
     try {
         childIdentificationMode = (ChildIdentificationMode)info.GetValue("childIdentificationMode",typeof(ChildIdentificationMode));
     } catch (SerializationException e) {
         //file was recorded using old version of this plugin
         childIdentificationMode = ChildIdentificationMode.IDENTIFY_BY_ORDER;
     }
     try {
         gameObjectName = info.GetString("gameObjectName");
     } catch (SerializationException e) {
         //file was recorded using old version of this plugin
         childIdentificationMode = ChildIdentificationMode.IDENTIFY_BY_ORDER;
         gameObjectName = "name_untraceable";
     }
 }
开发者ID:jiangkuo888,项目名称:ORP_beta,代码行数:24,代码来源:Object2PropertiesMapping.cs

示例8: ActionPreferenceStopException

        /// <summary>
        /// Initializes a new instance of the ActionPreferenceStopException class
        /// using data serialized via
        /// <see cref="ISerializable"/>
        /// </summary>
        /// <param name="info"> serialization information </param>
        /// <param name="context"> streaming context </param>
        /// <returns> constructed object </returns>
        protected ActionPreferenceStopException(SerializationInfo info,
                                                StreamingContext context)
                    : base(info, context)
        {
            bool hasErrorRecord = info.GetBoolean("HasErrorRecord");
            if (hasErrorRecord)
                _errorRecord = (ErrorRecord)info.GetValue("ErrorRecord", typeof(ErrorRecord));

            // fix for BUG: Windows Out Of Band Releases: 906263 and 906264
            // The interpreter prompt CommandBaseStrings:InquireHalt
            // should be suppressed when this flag is set.  This will be set
            // when this prompt has already occurred and Break was chosen,
            // or for ActionPreferenceStopException in all cases.
            this.SuppressPromptInInterpreter = true;
        }
开发者ID:40a,项目名称:PowerShell,代码行数:23,代码来源:ExecutionExceptions.cs

示例9: CmdletInvocationException

 /// <summary>
 /// Initializes a new instance of the CmdletInvocationException class
 /// using data serialized via
 /// <see cref="ISerializable"/>
 /// </summary>
 /// <param name="info"> serialization information </param>
 /// <param name="context"> streaming context </param>
 /// <returns> constructed object </returns>
 protected CmdletInvocationException(SerializationInfo info,
                                     StreamingContext context)
             : base(info, context)
 {
     bool hasErrorRecord = info.GetBoolean("HasErrorRecord");
     if (hasErrorRecord)
         _errorRecord = (ErrorRecord)info.GetValue("ErrorRecord", typeof(ErrorRecord));
 }
开发者ID:40a,项目名称:PowerShell,代码行数:16,代码来源:ExecutionExceptions.cs


注:本文中的SerializationInfo.GetBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。