public static CourseProxy New(string name) { if (!CourseLoader.GetAllCoursewares().Contains(name)) { var cd = CourseLoader.NewCourseware(name); if (cd.Title.IsNotNullAndEmpty()) { var proxy = new CourseProxy(); proxy.CoursewareData = cd; return(proxy); } } return(null); }
private void Start() { doOnceNew.OnExit += () => { proxy = CourseProxy.New("set"); }; doOnceOpen.OnExit += () => { proxy = CourseProxy.Open("set"); }; doOnceSave.OnExit += () => { proxy.Save(); }; }
public static CourseProxy Open(string name) { if (CourseLoader.GetAllCoursewares().Contains(name)) { var cd = CourseLoader.OpenCourseware(name); if (cd != null) { var proxy = new CourseProxy(); proxy.CoursewareData = cd; proxy.LoadCourseware(); return(proxy); } } return(null); }