public void Add(LogFormat f) { // Make sure the child controls exist. this.EnsureChildControls(); // Insert the log format into the selector. LogFormatSelector selector = (LogFormatSelector)this.Controls[0]; selector.Add(f); }
private void handle_select_log_format(object sender, EventArgs e) { // Get the selected log format. LogFormatSelector selector = (LogFormatSelector)this.Controls[0]; LogFormat lf = selector.SelectedLogFormat; // Create a new LogFormatNode for the selected LogFormat. LogFormatNode node = new LogFormatNode(); this.holder_.Controls.Add(node); // Set the value of the node. node.Value = lf; // Save selected log format and update candidate formats. this.selected_.Add(lf); foreach (Control c in this.holder_.Controls) { node = (LogFormatNode)c; node.CandidateChildren(this.selected_); } }