Example #1
0
        public static void save()
        {
            if (!VisibilityManager.wasLoaded)
            {
                return;
            }
            string path          = IOUtility.rootPath + "/Cloud/Visibility.config";
            string directoryName = Path.GetDirectoryName(path);

            if (!Directory.Exists(directoryName))
            {
                Directory.CreateDirectory(directoryName);
            }
            using (StreamWriter streamWriter = new StreamWriter(path))
            {
                IFormattedFileWriter formattedFileWriter = new KeyValueTableWriter(streamWriter);
                formattedFileWriter.writeKey("Groups");
                formattedFileWriter.beginArray();
                foreach (IVisibilityGroup visibilityGroup in VisibilityManager.groups)
                {
                    formattedFileWriter.beginObject();
                    formattedFileWriter.writeValue("Name", visibilityGroup.internalName);
                    formattedFileWriter.writeValue <Type>("Type", visibilityGroup.GetType());
                    formattedFileWriter.writeValue <IVisibilityGroup>("Group", visibilityGroup);
                    formattedFileWriter.endObject();
                }
                formattedFileWriter.endArray();
            }
        }
Example #2
0
        public static void save(string name)
        {
            if (!DevkitWindowLayout.wasLoaded)
            {
                return;
            }
            string path          = IOUtility.rootPath + "/Cloud/Layouts/" + name + ".layout";
            string directoryName = Path.GetDirectoryName(path);

            if (!Directory.Exists(directoryName))
            {
                Directory.CreateDirectory(directoryName);
            }
            using (StreamWriter streamWriter = new StreamWriter(path))
            {
                IFormattedFileWriter formattedFileWriter = new KeyValueTableWriter(streamWriter);
                formattedFileWriter.writeKey("Root");
                DevkitWindowManager.partition.write(formattedFileWriter);
                formattedFileWriter.writeKey("Containers");
                formattedFileWriter.beginArray();
                for (int i = 0; i < DevkitWindowManager.containers.Count; i++)
                {
                    formattedFileWriter.beginObject();
                    Sleek2PopoutContainer sleek2PopoutContainer = DevkitWindowManager.containers[i];
                    formattedFileWriter.writeValue <Type>("Type", sleek2PopoutContainer.GetType());
                    formattedFileWriter.writeValue <Sleek2PopoutContainer>("Container", sleek2PopoutContainer);
                    formattedFileWriter.endObject();
                }
                formattedFileWriter.endArray();
            }
        }