示例#1
0
        void GetProfileSettingsSerializeAsAttribute(ProfileSection ps, CodeAttributeDeclarationCollection collection,
                                                    SerializationMode mode)
        {
            string parameter = String.Concat("SettingsSerializeAs.", mode.ToString());

            collection.Add(
                new CodeAttributeDeclaration(
                    "SettingsSerializeAs",
                    new CodeAttributeArgument(
                        new CodeSnippetExpression(parameter)
                        )
                    )
                );
        }
 private static void WriteSerializerTag(Stream SS, string Version, SerializationMode mode, byte[] CypherKey, byte[] IV, bool Compression)
 {
     WriteTag(SS, TAGS.SerializerVersionTag, Version);
     WriteTag(SS, TAGS.SerializationModeTag, mode.ToString());
     WriteTag(SS, TAGS.EncriptionTag, Convert.ToString(((CypherKey != null) ? "Enabled" : "Disabled")));
     WriteTag(SS, TAGS.CompressionTag, Convert.ToString((Compression ? "Enabled" : "Disabled")));
     if ((IV != null))
     {
         WriteTag(SS, TAGS.InitializationVectorTag, Convert.ToBase64String(IV));
     }
     if ((CypherKey != null))
     {
         WriteTag(SS, TAGS.PwdHashTag, Convert.ToBase64String(GenerateHash(CypherKey)));
     }
     WriteEndTag(SS);
 }
示例#3
0
		void GetProfileSettingsSerializeAsAttribute (ProfileSection ps, CodeAttributeDeclarationCollection collection,
							     SerializationMode mode)
		{
			string parameter = String.Concat ("SettingsSerializeAs.", mode.ToString ());
			collection.Add (
				new CodeAttributeDeclaration (
					"SettingsSerializeAs",
					new CodeAttributeArgument (
						new CodeSnippetExpression (parameter)
					)
				)
			);
					
		}