/// <summary> /// Creates a LayerStackConfigControl and adds it to the list of controls to be displayed. /// </summary> public void AddLayerStackConfigControl() { var layerStackConfigControl = new LayerstackConfigControl(); layerStackConfigControl.LayerAdded += LayerStackConfigControl_LayerAdded; layerStackConfigControl.LayerRemoved += LayerStackConfigControl_LayerRemoved; layerStackConfigControl.LayerNameChanged += LayerStackConfigControl_LayerNameChanged; layerStackConfigControl.LayerIndexChanged += LayerStackConfigControl_LayerIndexChanged; tempControls.Add(layerStackConfigControl); }
/// <summary> /// Clears the controls in the property control. /// </summary> public void ClearControls() { if (RetainScrollPosition) { scrollPosition = flpContents.VerticalScroll.Value; } foreach (Control c in flpContents.Controls) { if (c is InterfaceConfigControl) { InterfaceConfigControl icc = c as InterfaceConfigControl; icc.InterfaceChanged -= InterfaceConfigControl_InterfaceChanged; icc.Closing -= ConfigControl_Closing; } else if (c is RouteConfigControl) { RouteConfigControl rcc = c as RouteConfigControl; rcc.RouteChanged -= RouteConfigControl_RouteChanged; rcc.Closing -= ConfigControl_Closing; } else if (c is GwConfigControl) { GwConfigControl gcc = c as GwConfigControl; gcc.GatewayChanged -= GWConfigControl_GatewayChanged; gcc.Closing -= ConfigControl_Closing; } else if (c is LayerstackConfigControl) { LayerstackConfigControl lscc = c as LayerstackConfigControl; lscc.LayerAdded -= LayerStackConfigControl_LayerAdded; lscc.LayerRemoved -= LayerStackConfigControl_LayerRemoved; lscc.LayerNameChanged -= LayerStackConfigControl_LayerNameChanged; lscc.LayerIndexChanged -= LayerStackConfigControl_LayerIndexChanged; lscc.Closing -= ConfigControl_Closing; } else if (c is AddInterfaceButton) { AddInterfaceButton aib = c as AddInterfaceButton; aib.Click -= AddInterfaceButton_Click; } else if (c is AddRouteButton) { AddRouteButton arb = c as AddRouteButton; arb.Click -= AddRouteButton_Click; } } flpContents.Controls.Clear(); interfaceConfigControls.Clear(); routeConfigControls.Clear(); tempControls.Clear(); }