public SpaceController(IProjectLoader projectLoader, IDbContextRegistry dbContextRegistry, IFormBuilderController formBuilderController,
                               IQueryController queryController)
        {
            _projectLoader         = projectLoader;
            _formBuilderController = formBuilderController;
            _queryController       = queryController;
            _registeredContexts    = dbContextRegistry.GetContexts();
            _formCodeGenerator     = new FormCodeGenerator();

            CreateNewProject();

            // ToDo: remove demo data initialization
            LoadModel(@"C:\Repos\MasterDetailsDataEntry\Seed\App.SqlForms.DevSpace\SqlForms.DevSpace\data\Project1");

            //var sch = "Schema1";
            //var s1 = new StoreSchema { Name = sch };
            //Model.Schemas.Add(new SchemaDetails { Schema = s1 });
            //var f1 = new StoreForm { Name = "CustomerEdit" };
            //ActiveWindowName = "CustomerEdit";
            //Model.Forms.Add(new FormDetails { Form = f1 });
            //Model.Forms.Add(new FormDetails { Form = new StoreForm { Name = "CustomerList" } });
            //Model.Forms.Add(new FormDetails { Form = new StoreForm { Name = "CustomerAddressList" } });
            ////Model.EditWindows.Add(new EditWindowDetails { StoreObject = s1, Type = EditWindowType.Schema });

            //Model.Queries.Add(new QueryDetails { Query = new StoreQuery { Name = "GetCustomerAddressList" } });
            //Model.Queries.Add(new QueryDetails { Query = new StoreQuery { Name = "GetCustomerList" } });

            //Model.EditWindows.Add(new EditWindowDetails { StoreObject = f1, Type = EditWindowType.Form });
            //UpdateFormBuilder();
        }
        public void SelectPropertiesFromNewTable(IQueryController qc, QueryFromTable newTable)
        {
            var selectedProps = qc.SelectionProperties.ToDictionary(p => p.OutputName, p => p);

            foreach (var p in newTable.Properties)
            {
                if (!selectedProps.ContainsKey(p.StoreProperty.Name))
                {
                    p.Selected = true;
                    qc.AddSelectionProperty(newTable, p);
                }
            }
        }