Exemplo n.º 1
0
        /// <summary>
        /// Loads the model from a user-chosen file.
        /// </summary>
        public IEnumerable <IResult> Open()
        {
            var file = new ChooseFileResult {
                Filter = PipelineFilter
            };

            yield return(file);            // Let user/test code choose a file, then continue

            using (var car = file.Stream())
                Model = Deserialize(car);
            modelBase = Serialize(Model);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Saves the current model in a user-chosen file.
        /// </summary>
        public IEnumerable <IResult> Save()
        {
            var file = new ChooseFileResult {
                OpenReadOnly = false, Filter = PipelineFilter
            };

            yield return(file);            // Let user/test code choose a file, then continue

            var serializer = new NetDataContractSerializer();

            using (var stream = file.Stream())
                Serialize(stream, Model);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Renders an output into a user-chosen file.
        /// </summary>
        public IEnumerable <IResult> SaveNodeOutput(Node.Output output)
        {
            var file = new ChooseFileResult {
                Filter = "YUV-Video|*.yuv", OpenReadOnly = false
            };

            yield return(file);

            IoC.Get <IWindowManager>().ShowDialog(new SaveNodeOutputViewModel(output, file.Stream(), Parent.Parent.Model));
        }