Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/10 00:44:01 (14 years ago)
Author:
swagner
Message:

Sorted usings and removed unused usings in entire solution (#1094)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/IO/GenericFormatter.cs

    r2768 r4068  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Text;
    41using System.IO;
    5 using System.Runtime.Serialization.Formatters.Binary;
    62using System.Runtime.Serialization;
    73
    8 namespace Netron.Diagramming.Core
    9 {
     4namespace Netron.Diagramming.Core {
     5  /// <summary>
     6  /// Generic implementation of the <see cref="IGenericFormatter"/> interface.
     7  /// </summary>
     8  /// <typeparam name="F"></typeparam>
     9  public class GenericFormatter<F> : IGenericFormatter where F : IFormatter, new() {
     10    IFormatter m_Formatter = new F();
     11
    1012    /// <summary>
    11     /// Generic implementation of the <see cref="IGenericFormatter"/> interface.
     13    /// Deserializes the specified serialization stream.
    1214    /// </summary>
    13     /// <typeparam name="F"></typeparam>
    14     public class GenericFormatter<F> : IGenericFormatter where F : IFormatter, new()
    15     {
    16         IFormatter m_Formatter = new F();
     15    /// <param name="serializationStream">The serialization stream.</param>
     16    /// <returns></returns>
     17    public T Deserialize<T>(Stream serializationStream) {
     18      return (T)m_Formatter.Deserialize(serializationStream);
     19    }
     20    /// <summary>
     21    /// Serializes the specified serialization stream.
     22    /// </summary>
     23    /// <param name="serializationStream">The serialization stream.</param>
     24    /// <param name="graph">A parameter of the generics Type T</param>
     25    public void Serialize<T>(Stream serializationStream, T graph) {
     26      m_Formatter.Serialize(serializationStream, graph);
     27    }
     28  }
    1729
    18         /// <summary>
    19         /// Deserializes the specified serialization stream.
    20         /// </summary>
    21         /// <param name="serializationStream">The serialization stream.</param>
    22         /// <returns></returns>
    23         public T Deserialize<T>(Stream serializationStream)
    24         {
    25             return (T) m_Formatter.Deserialize(serializationStream);
    26         }
    27         /// <summary>
    28         /// Serializes the specified serialization stream.
    29         /// </summary>
    30         /// <param name="serializationStream">The serialization stream.</param>
    31         /// <param name="graph">A parameter of the generics Type T</param>
    32         public void Serialize<T>(Stream serializationStream, T graph)
    33         {
    34             m_Formatter.Serialize(serializationStream, graph);
    35         }
    36     }
    37    
    3830}
Note: See TracChangeset for help on using the changeset viewer.