Exemplo n.º 1
0
        internal static Upfile LoadXml(string path)
        {
            try
            {
                StrictXmlDeserializer <Upfile> deserializer = new StrictXmlDeserializer <Upfile>();

                using (FileStream fs = new FileStream(path, FileMode.Open))
                {
                    Upfile upfile = deserializer.Deserialize(fs);

                    upfile.MakePathConfigurationsOSFriendly();
                    upfile.LoadOverrides();

                    if (upfile.Repositories != null)
                    {
                        foreach (Repository repo in upfile.Repositories)
                        {
                            if (repo is FileRepository)
                            {
                                (repo as FileRepository).Path = Uplift.Common.FileSystemUtil.MakePathOSFriendly((repo as FileRepository).Path);
                            }
                        }
                    }

                    Debug.Log("Upfile was successfully loaded");
                    return(upfile);
                }
            }
            catch (Exception e)
            {
                throw new ApplicationException("Uplift: Could not load Upfile", e);
            }
        }
Exemplo n.º 2
0
        internal static Upfile LoadXml(string path)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(Upfile));

            using (FileStream fs = new FileStream(path, FileMode.Open))
            {
                Upfile upfile = serializer.Deserialize(fs) as Upfile;

                upfile.MakePathConfigurationsOSFriendly();
                upfile.LoadOverrides();

                if (upfile.Repositories != null)
                {
                    foreach (Repository repo in upfile.Repositories)
                    {
                        if (repo is FileRepository)
                        {
                            (repo as FileRepository).Path = FileSystemUtil.MakePathOSFriendly((repo as FileRepository).Path);
                        }
                    }
                }

                return(upfile);
            }
        }