/// <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); }
/// <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); }
/// <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)); }