Esempio n. 1
0
        void UpdateProject()
        {
            Type[] extraTypes = new Type[]
            {
                typeof(ObjectListing),
                typeof(FrameworkCreation),
                typeof(string[])
            };

            ProjectFile proj = SerializationHelper.Deserialize <ProjectFile>(
                projectFilepath, false, "", extraTypes);

            if (filepath.Contains("Content\\"))
            {
                string[] split = filepath.Split(new char[]
                {
                    '/', '\\', '.'
                }, StringSplitOptions.RemoveEmptyEntries);

                string path = "";
                int    idx  = 0;

                for (int i = 0; i < split.Length; i++)
                {
                    if (split[i] == "Content")
                    {
                        idx = i + 1;
                    }
                }

                for (int i = idx; i < split.Length - 1; i++)
                {
                    path += split[i];

                    if (i != split.Length - 2)
                    {
                        path += "\\";
                    }
                }

                FrameworkCreation frame = proj.Framework;
                frame.AudioMangerFilepath = path;

                proj.Framework = frame;

                SerializationHelper.Serialize <ProjectFile>(proj,
                                                            projectFilepath, extraTypes);

                SerializationHelper.Serialize <FrameworkCreation>(proj.Framework,
                                                                  rootPath + "Content\\Eon.Engine");
            }
        }
Esempio n. 2
0
        void UpdateProject()
        {
            Type[] extraTypes = new Type[]
            {
                typeof(ObjectListing),
                typeof(FrameworkCreation),
                typeof(string[])
            };

            ProjectFile proj = SerializationHelper.Deserialize <ProjectFile>(
                projectFilepath, false, "", extraTypes);

            if (filepath.Contains("Content\\"))
            {
                string[] split = filepath.Split(new char[]
                {
                    '/', '\\'
                }, StringSplitOptions.RemoveEmptyEntries);

                string path = "";
                int    idx  = 0;

                for (int i = 0; i < split.Length; i++)
                {
                    if (split[i] == "Content")
                    {
                        idx = i + 1;
                    }
                }

                for (int i = idx; i < split.Length; i++)
                {
                    path += split[i];

                    if (i != split.Length - 1)
                    {
                        path += "\\";
                    }
                }

                FrameworkCreation frame = proj.Framework;

                if (frame.DictionaryFilepaths[0].Equals("NULL"))
                {
                    frame.DictionaryFilepaths = new string[] { path }
                }
                ;
                else
                {
                    List <string> paths = new List <string>(frame.DictionaryFilepaths);
                    paths.Add(path);

                    frame.DictionaryFilepaths = paths.ToArray();
                }

                proj.Framework = frame;

                SerializationHelper.Serialize <ProjectFile>(proj,
                                                            projectFilepath, extraTypes);

                SerializationHelper.Serialize <FrameworkCreation>(proj.Framework,
                                                                  rootPath + "Content\\Eon.Engine");
            }
        }