Exemple #1
0
        public string Serialize(ISdmlDataElement data)
        {
            if (data == null)
            {
                throw new ArgumentException("Data cannot be null!");
            }

            var generator = new SdmlGenerator();

            generator.Build(data);
            generator.Serialize();

            Data = generator.GetData();

            return(Data);
        }
Exemple #2
0
        public string GetSdml()
        {
            var sdmlGen = new SdmlGenerator();

            sdmlGen.Build(new SdmlDocument(
                              new SdmlNameAttribute("Sdml.NET Library Description"),
                              new SdmlSolution(
                                  new SdmlNameAttribute("Sdml.NET"),
                                  new SdmlTypeAttribute(".NET Standard Library"),
                                  new SdmlProject(
                                      new SdmlNameAttribute("Sdml.NET"),
                                      new SdmlClass(
                                          new SdmlNameAttribute("InvalidNodeException"),
                                          new SdmlMethod(
                                              new SdmlNameAttribute("ThisMethodDoesNotEvenExist"),
                                              new SdmlDescription(
                                                  "This is some random method. And this is its description.",
                                                  new SdmlNameAttribute("ExampleDescription"))))))));

            sdmlGen.Serialize();

            return(sdmlGen.Tree.Root.Data);
        }