Esempio n. 1
0
        CheckGraphDirectedness
        (
            IGraph graph,
            Boolean loading
        )
        {
            AssertValid();

            GraphDirectedness eDirectedness = graph.Directedness;

            if (SupportsDirectedness(eDirectedness))
            {
                return;
            }

            throw new IOException(String.Format(

                                      "The graph can't be {0} as the file type you've selected, because"
                                      + " the graph is {1} and the file type can't be used with {1}"
                                      + " graphs."
                                      ,
                                      loading ? "loaded" : "saved",

                                      EnumUtil.SplitName(eDirectedness.ToString(),
                                                         EnumSplitStyle.AllWordsStartLowerCase)
                                      ));
        }
Esempio n. 2
0
        /// <summary>
        /// Serialize Network View Properties
        /// </summary>
        /// <param name="tw"></param>

        public void Serialize(XmlTextWriter tw)
        {
            if (!NetworkPropertiesEnabled)
            {
                return;
            }

            tw.WriteStartElement("NetworkProperties");

            tw.WriteAttributeString("GraphDirectedness", GraphDirectedness.ToString());

            LayoutSettingsMx s = LayoutSettings;             // layout settings

            tw.WriteAttributeString("LayoutType", s.LayoutType.ToString());
            tw.WriteAttributeString("LayoutStyle", s.LayoutStyle.ToString());
            tw.WriteAttributeString("GroupRectanglePenWidth", s.GroupRectanglePenWidth.ToString());
            tw.WriteAttributeString("IntergroupEdgeStyle", s.IntergroupEdgeStyle.ToString());
            tw.WriteAttributeString("ImproveLayoutOfGroups", s.ImproveLayoutOfGroups.ToString());
            tw.WriteAttributeString("MaximumVerticesPerBin", s.MaximumVerticesPerBin.ToString());
            tw.WriteAttributeString("BinLength", s.BinLength.ToString());
            tw.WriteAttributeString("FruchtermanReingoldC", s.FruchtermanReingoldC.ToString());
            tw.WriteAttributeString("FruchtermanReingoldIterations", s.FruchtermanReingoldIterations.ToString());
            tw.WriteAttributeString("Margin", s.Margin.ToString());

            tw.WriteAttributeString("VertexGroupMethod", VertexGroupMethod.ToString());
            tw.WriteAttributeString("GroupingDisabled", GroupingDisabled.ToString());
            tw.WriteAttributeString("GraphScale", GraphScale.ToString());

            Vertex1.Serialize("Vertex1", tw);
            Vertex2.Serialize("Vertex1", tw);

            Edge.Serialize("Edge", tw);
            ResultsViewProps.SerializeQueryColumn(GroupByQc, "GroupByQc", tw);

            tw.WriteEndElement();             // NetworkProperties
            return;
        }