Ejemplo n.º 1
0
        /// <summary>
        /// Serializes the experiment.
        /// </summary>
        /// <param name="experiment">The experiment to be serialized.</param>
        /// <param name="writer">The writer.</param>
        /// <param name="library">The library - needed for post XML processing to determine if components has been located in library, and needed to show their definition and description.</param>
        public static void SerializeExperiment(XmlWriter writer, IExperiment experiment)
        {
            var factory = new ExperimentFactoryWriter();

            experiment.SerializeToXml(writer,
                                      (QuickGraph.VertexIdentity <ExperimentNode>)(v => v.ID),
                                      (QuickGraph.EdgeIdentity <ExperimentNode, ExperimentNodeConnection>)(e => e.ID),
                                      "graph", "node", "edge", "",
                                      factory.WriteGraphAttributes,
                                      factory.WriteNodeAttributes,
                                      factory.WriteEdgeAttributes);
        }
        /// <summary>
        /// Serializes the experiment.
        /// </summary>
        /// <param name="experiment">The experiment to be serialized.</param>
        /// <param name="writer">The writer.</param>
        /// <param name="library">The library - needed for post XML processing to determine if components has been located in library, and needed to show their definition and description.</param>
        public static void SerializeExperiment(XmlWriter writer, IExperiment experiment)
        {
            var factory = new ExperimentFactoryWriter();

            experiment.SerializeToXml(writer,
                (QuickGraph.VertexIdentity<ExperimentNode>)(v => v.ID),
                (QuickGraph.EdgeIdentity<ExperimentNode, ExperimentNodeConnection>)(e => e.ID),
                "graph", "node", "edge", "",
                factory.WriteGraphAttributes,
                factory.WriteNodeAttributes,
                factory.WriteEdgeAttributes);
        }