コード例 #1
0
ファイル: XMLDesignForm.cs プロジェクト: eksotama/FBXpert
        public void RefreshXml()
        {
            _ddc.Tables = StaticTreeClass.GetAllTableObjectsComplete(_dbReg);
            _ddc.Views  = StaticTreeClass.GetViewObjects(_dbReg);
            StaticTreeClass.GetAllTablePrimaryKeyObjects(_dbReg, _ddc.Tables);
            _ddc.Database = _dbReg;
            var fs         = new FileStream(Application.StartupPath + "\\temp\\tmp.xml", FileMode.Create);
            var serializer = new ConfigurationContainer().Create();
            var xml        = serializer.Serialize(fs, _ddc);



//            var serializer = new XmlSerializer(typeof(DatabaseDesignClass));
            //  var fs = new FileStream(Application.StartupPath + "\\temp\\tmp.xml", FileMode.Create);
            //serializer.Serialize(_ddc,Application.StartupPath + "\\temp\\tmp.xml");
            fs.Close();
            xmlEditStruktur.LoadXmlFromFile(Application.StartupPath + "\\temp\\tmp.xml");
        }
コード例 #2
0
ファイル: AutocompleteClass.cs プロジェクト: eksotama/FBXpert
        public void RefreshAutocompleteForDatabase()
        {
            //create autocomplete popup menu

            var actTables       = StaticTreeClass.GetAllTableObjects(_dbReg);
            var actSystemTables = StaticTreeClass.GetSystemTableObjects(_dbReg);
            var actViews        = StaticTreeClass.GetViewObjects(_dbReg);

            _popupMenu = new AutocompleteMenu(_txtBox)
            {
                MinFragmentLength = 1
            };

            var words = new List <string>();

            words.AddRange(SqlCommands());
            words.AddRange(DatabaseTables(actTables));
            words.AddRange(DatabaseViews(actViews));
            words.AddRange(DatabaseSystemTables(actSystemTables));

            if (actTables != null)
            {
                words.AddRange(DatabaseTableFields(actTables));
            }
            if (actViews != null)
            {
                words.AddRange(DatabaseViewFields(actViews));
            }
            if (actSystemTables != null)
            {
                words.AddRange(DatabaseSystemTableFields(actSystemTables));
            }

            _popupMenu.SearchPattern = @"[\w\.$]";
            _popupMenu.Items.SetAutocompleteItems(words);
            _popupMenu.AllowTabKey = true;

            //size of popupmenu
            _popupMenu.Items.MaximumSize = new System.Drawing.Size(400, 500);
            _popupMenu.Items.Width       = 400;
        }
コード例 #3
0
        private void GetDatabaseObjects2(DBRegistrationClass dbR)
        {
            if (dbR == null)
            {
                return;
            }
            this.Cursor = Cursors.WaitCursor;
            var db  = dbR.Clone();
            var ddc = new DatabaseDesignClass
            {
                Tables = StaticTreeClass.GetAllTableObjectsComplete(db),
                Views  = StaticTreeClass.GetViewObjects(db)
            };

            var generators = StaticTreeClass.GetGeneratorObjects(db);
            var procedures = StaticTreeClass.GetProcedureObjects(db);

            slbDbObjects2.ClearItems();
            foreach (var tc in ddc.Tables.Values)
            {
                slbDbObjects2.Add($@"TABLE.{tc.Name}", CheckState.Checked, tc);
            }

            foreach (var tc in ddc.Views.Values)
            {
                slbDbObjects2.Add($@"VIEW.{tc.Name}", CheckState.Checked, tc);
            }

            foreach (var tc in generators.Values)
            {
                slbDbObjects2.Add($@"GEN.{tc.Name}", CheckState.Checked, tc);
            }

            foreach (var tc in procedures.Values)
            {
                slbDbObjects2.Add($@"PROC.{tc.Name}", CheckState.Checked, tc);
            }
            this.Cursor = Cursors.Default;
        }
コード例 #4
0
ファイル: EXPORTDataForm.cs プロジェクト: eksotama/FBXpert
        public EXPORTDataForm(Form parent, DBRegistrationClass drc)
        {
            InitializeComponent();
            this.MdiParent = parent;

            localNotify = new NotifiesClass()
            {
                NotifyType  = eNotifyType.ErrorWithoutMessage,
                AllowErrors = false
            };
            localNotify.Notify.OnRaiseInfoHandler  += new NotifyInfos.RaiseNotifyHandler(InfoRaised);
            localNotify.Notify.OnRaiseErrorHandler += new NotifyInfos.RaiseNotifyHandler(ErrorRaised);

            DBReg = drc;

            var viewobjects      = StaticTreeClass.GetViewObjects(DBReg);
            var tableObjects     = StaticTreeClass.GetAllTableObjectsComplete(DBReg);
            var domainObjects    = StaticTreeClass.GetDomainObjects(DBReg);
            var generatorObjects = StaticTreeClass.GetGeneratorObjects(DBReg);
            var indecesObjects   = StaticTreeClass.GetIndecesObjects(DBReg);
            var triggerObjects   = StaticTreeClass.GetTriggerObjects(DBReg);
            //var procedureObjects = StaticTreeClass.GetAllProcedureObjects(DBReg);
            var procedureObjects = StaticTreeClass.GetProcedureObjects(DBReg);
            var functionObjects  = StaticTreeClass.GetInternalFunctionObjects(DBReg);

            if (tableObjects.Count <= 0)
            {
                return;
            }

            foreach (var tc in tableObjects.Values)
            {
                selTables.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selTables.CheckChecks();

            foreach (var tc in tableObjects.Values)
            {
                selStructureTables.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selStructureTables.CheckChecks();

            SelectAllTableFields();

            foreach (var tc in viewobjects.Values)
            {
                selStructureViews.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selStructureViews.CheckChecks();

            foreach (var tc in domainObjects.Values)
            {
                if ((tc.ToString().StartsWith("RDB$")) || (tc.ToString().StartsWith("SEC$")) || (tc.ToString().StartsWith("MON$")))
                {
                    continue;
                }
                selDomains.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selDomains.CheckChecks();

            foreach (var tc in generatorObjects.Values)
            {
                if ((tc.ToString().StartsWith("RDB$")) || (tc.ToString().StartsWith("SEC$")) || (tc.ToString().StartsWith("MON$")))
                {
                    continue;
                }
                selGenerators.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selGenerators.CheckChecks();


            foreach (var tc in triggerObjects.Values)
            {
                selTriggerStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selTriggerStructure.CheckChecks();


            foreach (var tc in indecesObjects.Values)
            {
                selIndeces.Add(tc.ToString(), CheckState.Unchecked, tc);
            }

            selIndeces.CheckChecks();

            foreach (var tc in procedureObjects.Values)
            {
                selProceduresStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selProceduresStructure.CheckChecks();

            foreach (var tc in functionObjects.Values)
            {
                selFunctionsStructure.Add(tc.ToString(), CheckState.Unchecked, tc);
            }
            selFunctionsStructure.CheckChecks();

            var itm = selTables.ItemDatas[0] as ItemDataClass;

            TableObject = itm.Object as TableClass;

            selExportStructureList.AllowMultipleChecks = true;

            selExportStructureList.Add("Domains", CheckState.Checked, new DomainClass());
            selExportStructureList.Add("UDFs", CheckState.Checked, new UserDefinedFunctionClass());
            selExportStructureList.Add("Generators", CheckState.Checked, new GeneratorClass());
            selExportStructureList.Add("Procedures", CheckState.Checked, new ProcedureClass());
            selExportStructureList.Add("Functions", CheckState.Checked, new FunctionClass());
            selExportStructureList.Add("Tables", CheckState.Checked, new TableClass());
            selExportStructureList.Add("Views", CheckState.Checked, new ViewClass());
            selExportStructureList.Add("Check constraints", CheckState.Checked, new ChecksClass());
            selExportStructureList.Add("Unique constraints", CheckState.Checked, new UniquesClass());
            selExportStructureList.Add("Primary keys", CheckState.Checked, new PrimaryKeyClass());
            selExportStructureList.Add("Foreign keys", CheckState.Checked, new ForeignKeyClass());
            selExportStructureList.Add("Indices", CheckState.Checked, new IndexClass());
            selExportStructureList.Add("Triggers", CheckState.Checked, new TriggerClass());

            selExportStructureList.Add("UDF descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Generator descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Procedure descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Table descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Table field descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("View descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("View field descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Index descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Trigger descriptions", CheckState.Checked, new object());
            selExportStructureList.Add("Procedure parameter descriptions", CheckState.Checked, new object());
        }
コード例 #5
0
ファイル: AutocompleteClass.cs プロジェクト: eksotama/FBXpert
        public string[] DatabaseViews()
        {
            var actViews = StaticTreeClass.GetViewObjects(_dbReg);

            return(DatabaseViews(actViews));
        }