Esempio n. 1
0
 private static void Persist(PostflightObjC postflight, string path)
 {
     XmlSerializer serializer = new XmlSerializer(postflight.GetType());
     using (XmlWriter writer = XmlWriter.Create(path)) {
         serializer.Serialize(writer, postflight);
     }
 }
Esempio n. 2
0
        public static PostflightObjC PostflightObjCForAssembly(string assemblyXmlPath)
        {
            PostflightObjC postflight = null;
            string path = null;

            if (assemblyXmlPath != null)
            {
                // get the postflight path
                path = Path.ChangeExtension(assemblyXmlPath, "codegen.postflight.objc.xml");

                if (File.Exists(path))
                {
                    XmlSerializer deserializer = new XmlSerializer(typeof (PostflightObjC));
                    try
                    {
                        using (XmlReader reader = XmlReader.Create(path))
                        {
                            postflight = (PostflightObjC) deserializer.Deserialize(reader);
                        }
                    }
                    catch (Exception e)
                    {
                        throw e;
                    }
                }
            }

            if (postflight == null)
            {
                postflight = new PostflightObjC();
            }

            return postflight;
        }