Пример #1
0
        void page_GetConnectionAttributes(object sender, ConnectionsEventArgs args)
        {
            Debug.Assert(this.Connections != null, "Connections is not valid!");

            this.ClearErrors();

            try
            {
                args.ConnectionManagers.Clear();

                foreach (ConnectionManager cm in this.Connections)
                {
                    if (cm.InnerObject is SsdsConnectionManager)
                    {
                        ConnectionManagerElement element = new ConnectionManagerElement();

                        element.ID       = cm.ID;
                        element.Name     = cm.Name;
                        element.Selected = element.ID.Equals(this.ComponentMetadata.RuntimeConnectionCollection[0].ConnectionManagerID, StringComparison.OrdinalIgnoreCase);
                        args.ConnectionManagers.Add(element);
                    }
                }
            }
            catch (Exception ex)
            {
                this.ReportErrors(ex);
            }
        }
Пример #2
0
        private void LoadConnections()
        {
            if (this.GetConnectionAttributes != null)
            {
                ConnectionsEventArgs args = new ConnectionsEventArgs();
                this.GetConnectionAttributes(this, args);

                this.cmbCM.Items.Clear();

                bool selected = false;

                foreach (ConnectionManagerElement element in args.ConnectionManagers)
                {
                    this.cmbCM.Items.Add(element);

                    if (element.Selected)
                    {
                        selected = true;
                        this.cmbCM.SelectedIndex = args.ConnectionManagers.IndexOf(element);
                    }
                }

                if (args.ConnectionManagers.Count > 0 && !selected)
                {
                    this.cmbCM.SelectedIndex = 0;
                }

                this.LoadContainers((ConnectionManagerElement)this.cmbCM.SelectedItem);
            }
        }
Пример #3
0
        void page_GetConnectionAttributes(object sender, ConnectionsEventArgs args)
        {
            Debug.Assert(this.Connections != null, "Connections is not valid!");

            this.ClearErrors();

            try
            {
                args.ConnectionManagers.Clear();

                foreach (ConnectionManager cm in this.Connections)
                {
                    if (cm.InnerObject is SsdsConnectionManager)
                    {
                        ConnectionManagerElement element = new ConnectionManagerElement();

                        element.ID = cm.ID;
                        element.Name = cm.Name;
                        element.Selected = element.ID.Equals(this.ComponentMetadata.RuntimeConnectionCollection[0].ConnectionManagerID, StringComparison.OrdinalIgnoreCase);
                        args.ConnectionManagers.Add(element);
                    }
                }
            }
            catch (Exception ex)
            {
                this.ReportErrors(ex);
            }
        }
Пример #4
0
        private void LoadConnections()
        {
            if (this.GetConnectionAttributes != null)
            {
                ConnectionsEventArgs args = new ConnectionsEventArgs();
                this.GetConnectionAttributes(this, args);

                this.cmbCM.Items.Clear();

                bool selected = false;

                foreach (ConnectionManagerElement element in args.ConnectionManagers)
                {
                    this.cmbCM.Items.Add(element);

                    if (element.Selected)
                    {
                        selected = true;
                        this.cmbCM.SelectedIndex = args.ConnectionManagers.IndexOf(element);
                    }
                }

                if (args.ConnectionManagers.Count > 0 && !selected)
                {
                    this.cmbCM.SelectedIndex = 0;
                }

                this.LoadContainers((ConnectionManagerElement)this.cmbCM.SelectedItem);
            }
        }