public void ProviderChanged()
        {
            FdoProviderInfo prov = _view.SelectedProvider;

            if (prov != null)
            {
                _view.ResetDataStoreGrid();

                IList <DictionaryProperty> dprops = FdoFeatureService.GetCreateDataStoreProperties(prov.Name);
                if (dprops != null)
                {
                    foreach (DictionaryProperty p in dprops)
                    {
                        if (p.Enumerable)
                        {
                            EnumerableDictionaryProperty ep = p as EnumerableDictionaryProperty;
                            if (!ep.RequiresConnection)
                            {
                                _view.AddEnumerableDataStoreProperty(ep.Name, ep.DefaultValue, ep.Values);
                            }
                        }
                        else
                        {
                            _view.AddDataStoreProperty(p);
                        }
                    }
                    _view.CreateEnabled = true;
                }
                else
                {
                    _view.ShowError("Selected provider does not support creation of data stores");
                    _view.ResetDataStoreGrid();
                    _view.ResetConnectGrid();
                    _view.CreateEnabled = false;
                    return;
                }

                if (!prov.IsFlatFile)
                {
                    _view.ResetConnectGrid();
                    IList <DictionaryProperty> cprops = FdoFeatureService.GetConnectProperties(prov.Name);
                    if (cprops != null)
                    {
                        foreach (DictionaryProperty p in cprops)
                        {
                            if (p.Enumerable)
                            {
                                EnumerableDictionaryProperty ep = p as EnumerableDictionaryProperty;
                                if (!ep.RequiresConnection)
                                {
                                    _view.AddEnumerableConnectProperty(ep.Name, ep.DefaultValue, ep.Values);
                                }
                            }
                            else
                            {
                                _view.AddConnectProperty(p);
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void btnDestroy_Click(object sender, EventArgs e)
        {
            NameValueCollection props = DictionaryDialog.GetParameters(ResourceService.GetString("TITLE_DESTROY_DATASTORE"), FdoFeatureService.GetCreateDataStoreProperties(_presenter.Connection.Provider));

            if (props != null)
            {
                _presenter.DestroyDataStore(props);
                this.ShowMessage(null, ResourceService.GetString("MSG_DATA_STORE_DESTROYED"));
            }
        }