public override void SyncChanges() { LibraryTree parent = this.WebPartToEdit as LibraryTree; _libraryName.Text = parent.LibraryName; _expandDepth.Text = parent.ExpandDepth.ToString(); _showLines.Checked = parent.ShowLines; }
protected override void OnInit(EventArgs e) { base.OnInit(e); LibraryTree parent = this.WebPartToEdit as LibraryTree; _libraryName = new TextBox(); _libraryName.Text = parent.LibraryName; _expandDepth = new TextBox(); _expandDepth.Text = parent.ExpandDepth.ToString(); _showLines = new CheckBox(); _showLines.Checked = parent.ShowLines; }
public override bool ApplyChanges() { LibraryTree parent = this.WebPartToEdit as LibraryTree; parent.LibraryName = _libraryName.Text.Trim(); try { parent.ExpandDepth = int.Parse(_expandDepth.Text); } catch { parent.ExpandDepth = 0; } parent.ShowLines = _showLines.Checked; parent.SaveChanges(); return(true); }