void view_OpenProject(object sender, ProjectWithFileNameEventArgs e) { Stream stream = new FileStream(e.ProjectFileName, FileMode.Open, FileAccess.Read, FileShare.Read); try { IFormatter formatter = new BinaryFormatter(); ps = (ProjectSetting)formatter.Deserialize(stream); // wire events again ps.OpenProject(); View.PS = ps; if (ps.WatermarkCollection != null && ps.WatermarkCollection.Count > 0) { View.SelectedWatermarkIndex = 0; } else { View.ClearWatermarkArea(); } this.currentProjectFile = e.ProjectFileName; } catch (Exception ex) { SetErrorMessage(ex); } finally { stream.Close(); this.processing = false; } }