コード例 #1
0
        /// <summary>
        ///     Read TinkerGrapĥ metadata from a Stream.
        /// </summary>
        /// <param name="tinkerGrapĥ">the IGraph to push the metadata to</param>
        /// <param name="inputStream">the Stream to read the TinkerGrapĥ metadata from</param>
        public static void Load(TinkerGrapĥ tinkerGrapĥ, Stream inputStream)
        {
            Contract.Requires(tinkerGrapĥ != null);
            Contract.Requires(inputStream != null);

            var reader = new TinkerMetadataReader(tinkerGrapĥ);

            reader.Load(inputStream);
        }
コード例 #2
0
        /// <summary>
        ///     Read TinkerGrapĥ metadata from a file.
        /// </summary>
        /// <param name="tinkerGrapĥ">the TinkerGrapĥ to push the data to</param>
        /// <param name="filename">the name of the file to read the TinkerGrapĥ metadata from</param>
        public static void Load(TinkerGrapĥ tinkerGrapĥ, string filename)
        {
            Contract.Requires(tinkerGrapĥ != null);
            Contract.Requires(!string.IsNullOrWhiteSpace(filename));

            var reader = new TinkerMetadataReader(tinkerGrapĥ);

            reader.Load(filename);
        }
コード例 #3
0
            public override TinkerGrapĥ Load(string directory)
            {
                if (!Directory.Exists(directory))
                {
                    throw new Exception(string.Concat("Directory ", directory, " does not exist"));
                }

                var graph = new TinkerGrapĥ();

                LoadGraphData(graph, directory);

                var filePath = string.Concat(directory, GraphFileMetadata);

                if (File.Exists(filePath))
                {
                    TinkerMetadataReader.Load(graph, filePath);
                }

                return(graph);
            }