コード例 #1
0
 /// <summary>Handler called when the application starts up.</sumary>
 private void ApplicationStartup(object sender, StartupEventArgs e)
 {
     try
     {
         SerializerProvider.RegisterSerializer(SerializerDescriptor.CreateFromFactoryInstance(new XamlSerializerFactory()), false);
         SerializerProvider.RegisterSerializer(SerializerDescriptor.CreateFromFactoryInstance(new TxtSerializerFactory()), false);
         SerializerProvider.RegisterSerializer(SerializerDescriptor.CreateFromFactoryInstance(new RtfSerializerFactory()), false);
         SerializerProvider.RegisterSerializer(SerializerDescriptor.CreateFromFactoryInstance(new HtmlSerializerFactory()), false);
     }
     catch (ArgumentException)
     {
     }
 }
コード例 #2
0
 protected override void OnExit(ExitEventArgs e)
 {
     try
     {
         SerializerProvider.UnregisterSerializer(SerializerDescriptor.CreateFromFactoryInstance(new XamlSerializerFactory()));
         SerializerProvider.UnregisterSerializer(SerializerDescriptor.CreateFromFactoryInstance(new TxtSerializerFactory()));
         SerializerProvider.UnregisterSerializer(SerializerDescriptor.CreateFromFactoryInstance(new RtfSerializerFactory()));
         SerializerProvider.UnregisterSerializer(SerializerDescriptor.CreateFromFactoryInstance(new HtmlSerializerFactory()));
     }
     catch (ArgumentException)
     {
     }
     base.OnExit(e);
 }