Ejemplo n.º 1
0
        public object ReadCombine(XmlReader reader)
        {
            DataItem data = (DataItem)Read(reader);

            // Both combine and SolutionFolder use the same element name, but the types are different
            if (data.Name == "Combine" && objectType == typeof(SolutionFolder))
            {
                data.Name = "SolutionFolder";
            }

            SolutionFolder    folder;
            IExtendedDataItem obj = (IExtendedDataItem)serializer.CreateInstance(objectType, data);
            Solution          sol = obj as Solution;

            if (sol != null)
            {
                folder = sol.RootFolder;
                sol.ConvertToFormat(MD1ProjectService.FileFormat, false);
                sol.FileName = serializer.SerializationContext.BaseFile;
                folder.ExtendedProperties ["FileName"] = serializer.SerializationContext.BaseFile;
            }
            else
            {
                folder = (SolutionFolder)obj;
                obj.ExtendedProperties ["FileName"] = serializer.SerializationContext.BaseFile;
            }

            // The folder entries must be added before deserializing the folder
            // since other folder members depend on it

            foreach (SolutionItem ce in entries)
            {
                folder.Items.Add(ce);
            }

            serializer.Deserialize(obj, data);

            if (sol != null)
            {
                CreateSolutionConfigurations(sol);
                LoadStartupMode(sol);
            }


            return(obj);
        }