/// <summary>
        /// Display collection from view. DisplayPropertyName hold the name of property containing collection to display
        /// </summary>
        /// <param name="obj">view object</param>
        public void SetObjectCollection(IViewFct obj = null, bool modified = false)
        {
            if (obj == null)
            {
                obj = UseCurrentViewAsDefault ? (IViewFct)CurrentContext.CurrentView : CurrentContext.CurrentFunction;
            }

            if (obj != null && ConfigurationElementCollection(obj) != null)
            {
                list.BeginUpdate();

                WizardTools.Tools.setTreeViewFromCollection(list, ConfigurationElementCollection(obj), ChildPropertyName, this);

                AfterObjectCollectionSet?.Invoke(this, null);

                if (modified)
                {
                    OnCollectionModified?.Invoke(this, null);
                }

                list.EndUpdate();
            }
            else
            {
                list.Nodes.Clear();
            }

            updateDisplay();
        }
Exemplo n.º 2
0
        //--Editeur-->Champ
        public WizardField(IViewFct view, TabloidConfigColonne parentField, string connectionString, Provider provider)
        {
            _iviewFct         = view;
            _parentField      = parentField;
            _provider         = provider;
            _connectionString = connectionString;

            InitializeComponent();

            Champ.CloseFromNext += validateFieldCreation;
            Champ.CloseFromNext += validateFieldEditorCompliance;
            Champ.CloseFromBack += validateFieldCreation;
            Champ.ShowFromBack  += ChampShowCreation;

            Button.ShowFromBack += Button_ShowFromBack;
            Button.ShowFromNext += Button_ShowFromNext;

            Editeur.ShowFromNext  += Editeur_ShowFromNext;
            Editeur.CloseFromNext += Editeur_CloseFromNext;
            Editeur.ShowFromBack  += Editeur_ShowFromBack;

            Graphique.ShowFromNext += Graphique_ShowFromNext;
            Graphique.ShowFromBack += Graphique_ShowFromBack;

            visibilite.ShowFromBack  += Visbile_ShowFromBack;
            visibilite.CloseFromBack += Visbile_CloseFromBack;
            visibilite.Enter         += updateVisibilityList;

            if (_iviewFct is TabloidConfigView)
            {
                cmbGraph.DataSource = ((TabloidConfigView)view).Graphiques;
            }


            fs.ConnectionString     = _connectionString;
            fs.cmdSchema.DataSource = AppSetting.GetSchemaList(_provider);//.Items.Add("finance_subv");
            fs.Enabled = false;
        }
 /// <summary>
 /// return configuration element for given view or currentcollection if set
 /// </summary>
 public CollectionType ConfigurationElementCollection(IViewFct view)
 {
     return(CurrentCollection ?? (CollectionType)TreeViewHelper.GetPropValue(view, DisplayPropertyName));
 }