Exemplo n.º 1
0
        public string GetConnectionString(StructureObjectType endpoint = StructureObjectType.Database)
        {
            SqlConnectionStringBuilder connectionBuilder = new SqlConnectionStringBuilder();

            if (Server != null)
            {
                connectionBuilder.DataSource = Server.InternalName;
            }

            if (AuthenticationType == AuthenticationType.Windows)
            {
                connectionBuilder.IntegratedSecurity = true;
            }
            else
            {
                connectionBuilder.IntegratedSecurity = false;
                connectionBuilder.UserID             = Username;
                connectionBuilder.Password           = Password;
            }

            if (Database != null)
            {
                connectionBuilder.InitialCatalog = Database.InternalName;
            }

            return(connectionBuilder.ConnectionString);
        }
Exemplo n.º 2
0
        private StructureObject ValidateType(StructureObjectType requestedType, StructureObject structureObject)
        {
            if (structureObject == null)
            {
                return(null);
            }

            if (structureObject.ObjectType == requestedType)
            {
                return(structureObject);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 3
0
        private void edit_Complete(object sender, EventArgs e)
        {
            Control ctlSender = sender as Control;

            StructureObjectType objectType = (StructureObjectType)Enum.Parse(typeof(StructureObjectType), ctlSender.Tag.ToString());

            StructureObject structureObject;

            if (string.IsNullOrWhiteSpace(ctlSender.Text))
            {
                structureObject = null;
            }
            else
            {
                structureObject = new StructureObject(objectType)
                {
                    InternalName = ctlSender.Text,
                    FriendlyName = ctlSender.Text
                };
            }

            profile.GetType().GetProperty(ctlSender.Tag.ToString()).SetValue(profile, structureObject);
        }
Exemplo n.º 4
0
        private async void cbx_DropDown(object sender, EventArgs e)
        {
            ComboBox cbxSender = sender as ComboBox;

            ClearLowers(cbxSender.Tag);
            //UpdateAuthentication();

            StructureObjectType priorType = (StructureObjectType)Enum.Parse(typeof(StructureObjectType), cbxSender.Tag.ToString()) - 1;

            try
            {
                prbProgress.Style    = ProgressBarStyle.Marquee;
                cbxSender.DataSource = await StructureManager.QueryChildren((StructureObject)profile.GetType().GetProperty(priorType.ToString()).GetValue(profile), profile);
            }
            catch (Exception ex)
            {
                new MessageForm("Error", ex.Message);
            }
            finally
            {
                prbProgress.Style = ProgressBarStyle.Blocks;
            }
        }
Exemplo n.º 5
0
 public StructureObject(StructureObjectType objectType)
 {
     ObjectType = objectType;
     //Children = new List<StructureObject>();
 }