private void CreateNew() { if (m_toAdd == null) { throw new ArgumentNullException(nameof(m_toAdd)); } var titleType = (m_toAdd.Children == null) ? "章节名" : "卷名"; var name = m_toAdd.Title.Text; if (string.IsNullOrEmpty(name)) { m_general.SetError(m_toAdd.Title, "请输入" + titleType); return; } var parent = GetParent(m_root, m_toAdd); var m = (m_toAdd.Children == null) ? m_story.AddFragment(m_root.Model.Id, parent.Model.Id, name) as IOutline : m_story.AddCatalog(m_root.Model.Id, parent.Model.Id, name); if (m != null) { m_toAdd.SetModel(m); } m_general.EndEdit(m_toAdd.Title); }