private void ultraExplorerBar1_ItemClick(object sender, Infragistics.Win.UltraWinExplorerBar.ItemEventArgs e) { if (_pluginList[e.Item.Key].IsNecessarioEsercizio && (_condominioCorrente == null || _esercizioCorrente == null)) { Gipasoft.Stabili.UI.Library.CommonMessages.DisplayWarning("Scegliere un condominio e un esercizio."); } else { if (_pluginList.ContainsKey(e.Item.Key)) { if (saveForm()) { ultraExplorerBar1.SelectedGroup.Items[_currentPlugin.Caption.ToLower()].Active = true; return; } IPluginContabilita pluginInstance = _pluginList[e.Item.Key]; foreach (Control control in panelContent.Controls) control.Visible = false; if (_currentPlugin != null) _currentPlugin.OnExit(); _currentPlugin = pluginInstance; if (!panelContent.Controls.ContainsKey(pluginInstance.Caption)) { UserControl control = pluginInstance.GetControl(_condominioCorrente, _esercizioCorrente, MdiParent); panelContent.Controls.Add(control); control.Dock = DockStyle.Fill; _currentPlugin.SetLayout(); control.Name = pluginInstance.Caption; loadGridLayout(control.Controls); } else { panelContent.Controls[pluginInstance.Caption].Visible = true; pluginInstance.Reload(_condominioCorrente, _esercizioCorrente); } lblContent.Text = pluginInstance.Caption; if (_condominioCorrente != null) lblEsercizioAttuale.Text = _condominioCorrente.DisplayName; if(_esercizioCorrente != null) lblEsercizioAttuale.Text += " - " + _esercizioCorrente.DisplayName + " (" + _esercizioCorrente.DataApertura.Value.ToShortDateString() + " - " + _esercizioCorrente.DataChiusura.Value.ToShortDateString() + ")"; } } }