Esempio n. 1
0
        private void AddUserBlueprint(string path)
        {
            var blueprint = IOUtils.JsonDeserializeFromPath <Blueprint>(path);

            if (blueprint == null)
            {
                throw new ArgumentNullException("blueprint");
            }

            if (ContainsName(blueprint.name))
            {
                throw new ArgumentException($"Blueprint named \"{blueprint.name}\" is duplicate");
            }

            var args = new BlueprintContainerArgs(blueprint)
            {
                generateBlueprintFileHandle = true,
                generateBlueprintFileName   = false
            };

            var observableBlueprint = new BlueprintContainer(args);

            observableBlueprint.BlueprintFileHandle.CurrentPath = path;
            observableBlueprint.LoadThumbnail();
            userBlueprints.Add(observableBlueprint);
        }
Esempio n. 2
0
        public BlueprintContainer ToContainer()
        {
            var blueprint = IOUtils.JsonDeserializeWithSettings <Blueprint>(blueprintJson, SerializationMode.Readable);

            var args = new BlueprintContainerArgs(blueprint)
            {
                generateBlueprintFileHandle = false,
                useDefaultThumbnailFolder   = true
            };

            var container = new BlueprintContainer(args);

            container.LoadThumbnail();
            return(container);
        }