//public MainTextAreaViewModel() //{ // this.LoadDocument = new LoadDocumentCommand(this); //} public MainTextAreaViewModel(Project project) { // TODO: Complete member initialization this.CurrentProject = project; this.LoadDocument = new LoadDocumentCommand(this); this.SaveProjectCommand = new SaveProjectCommand(this); }
public static void UpdateProjectInFile(Project selectedProject) { string mainPath = Configuration.getMainPath() + selectedProject.ScriptName + "\\"; string titlePath = mainPath + "TITLE.txt"; string scenePathFormat = mainPath + "SCENE_{0}.txt"; File.WriteAllText(titlePath, selectedProject.ScriptName + "_" + selectedProject.Author); for (int i = 1; i < selectedProject.Scenes.Count + 1; i++) { string scenePath = string.Format(scenePathFormat, i); string sceneText = selectedProject.Scenes[i].GetDocFormat(); File.WriteAllText(scenePath, sceneText); } }
public MainWindowViewModel() { CurrentProject = new Project("ÇAPRAZ NEYLİ HİKAYE"); mainTextAreaVm = new MainTextAreaViewModel(CurrentProject); this.NewProjectCommand = new NewProjectCommand(this); this.OpenProjectCommand = new OpenProjectCommand(this); this.SaveProjectCommand = new SaveProjectCommand(mainTextAreaVm); this.SaveProjectAsCommand = new SaveProjectAsCommand(this); this.ExitCommand = new ExitCommand(this); this.UndoCommand = new UndoCommand(this); this.RedoCommand = new RedoCommand(this); this.CutCommand = new CutCommand(this); this.CopyCommand = new CopyCommand(this); this.PasteCommand = new PasteCommand(this); this.SelectAllCommand = new SelectAllCommand(this); this.FindCommand = new FindCommand(this); this.ReplaceCommand = new ReplaceCommand(this); this.ImportScriptCommand = new ImportScriptCommand(this); this.ExportScriptCommand = new ExportScriptCommand(this); this.OpenAboutPageCommand = new OpenAboutPageCommand(this); }