Exemple #1
0
            public void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info)
            {
                var s = (ScatterSymbolList)obj;

                info.SetProperty(GetSerializationRegistrationKey(s), "True"); // Register a property to note that this color set is already serialized.

                info.AddValue("Name", s._name);
                info.CreateArray("Elements", s._list.Count);
                foreach (var ele in s)
                {
                    info.AddValue("e", ele.Clone()); // Trick here: by cloning the value, it is a new instance that is not registered in the list manager, thus it has no parent, so that neither parent set nor parent name are serialized
                }
                info.CommitArray();
            }
Exemple #2
0
            public void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info)
            {
                var s = (ColorSet)obj;

                info.SetProperty(GetSerializationRegistrationKey(s), "True"); // Register a property to note that this color set is already serialized.

                info.AddValue("Name", s._name);

                info.CreateArray("Colors", s._innerList.Length);

                foreach (NamedColor c in s)
                {
                    info.CreateElement("e");
                    info.AddAttributeValue("Name", c.Name);
                    info.SetNodeContent(c.Color.ToInvariantString());
                    info.CommitElement();
                }

                info.CommitArray();
            }