Exemple #1
0
        private void FBXpertMainForm_Load(object sender, EventArgs e)
        {
            //   LanguageClass.Instance().InitEmbedded(this,"FBXpert.Languages","Language","de");
            LanguageClass.Instance().InitFile(this, $@"{Application.StartupPath}\Languages\", "Language", ".", "de");
            LanguageClass.Instance().OnRaiseLanguageExceptionHandler += FbXpertMainForm_OnRaiseLanguageExceptionHandler;
            LanguageClass.Instance().ChangeLanguage(LanguageClass.German);

            Text = $@"FBXpert V {Assembly.GetAssembly(GetType()).GetName().Version}";
            Application.DoEvents();
            var cf = FBXInfo.Instance();

            cf.MdiParent = this;
            cf.Show();

            _dbe = DbExplorerForm.Instance(this);
            if (_dbe.ReadDatabaseDefinition())
            {
                Application.DoEvents();
                NotifiesClass.Instance().InfoThreshold = eInfoLevel.normal;
                _dbe.SetCaption();
                _dbe.Show();
                _dbe.Enabled = false;
                _dbe.MakeDatabaseTree(false);
                _dbe.OpenActiveDatabases();
                if (NotificationsForm.Instance().Visible)
                {
                    NotificationsForm.Instance().Close();
                }
                NotifiesClass.Instance().InfoThreshold = eInfoLevel.few;
            }
            DbExplorerForm.Instance().Enabled = true;
            LanguageClass.Instance().ChangeLanguage(LanguageClass.German);
        }
Exemple #2
0
 public void SetLanguageControls()
 {
     this.Text = $@"{AppName}, V{AppVersion} Copyright by {s.Company} 2019";
     toolStripMenuItemWindows.Text          = LanguageClass.Instance().GetString("Windows");
     toolStripMenuItemLanguage.Text         = LanguageClass.Instance().GetString("Language");
     toolStripMenuItemCloseApplication.Text = LanguageClass.Instance().GetString("CloseApplication");
 }
Exemple #3
0
        private FbXpertMainForm()
        {
            InitializeComponent();

            NotificationsForm.Instance().Init();
            NotifiesClass.Instance().Notify.OnRaiseInfoHandler += InfoRaised;
            NotifiesClass.Instance().Notify.OnRaiseErrorHandler += ErrorRaised;

            LanguageClass.Instance().OnRaiseLanguageChangedHandler += FBXpertMainForm_OnRaiseLanguageChangedHandler;
            NotificationsForm.Instance().SetMDIForm(this);

            string appfile = Application.StartupPath + "\\config\\AppSettings.json";

            if (File.Exists(appfile))
            {
                AppSettingsClass appset = fastJSON.JSON.ToObject(File.ReadAllText(appfile)) as AppSettingsClass;
                AppSettingsClass.Instance().Load(appset);
            }
            else
            {
                AppSettingsClass.Instance();
            }
            NotifiesClass.Instance().InfoThreshold = eInfoLevel.normal;

            //(eInfoLevel) AppSettingsClass.Instance().BehavierSettings.DebugThreshold;
        }
Exemple #4
0
        public void RefreshLanguageText()
        {
            hsPageRefresh.Text       = LanguageClass.Instance().GetString("REFRESH");
            hsExportData.Text        = LanguageClass.Instance().GetString("EXPORT");
            hsCancelGettingData.Text = LanguageClass.Instance().GetString("CANCEL_READING");
            hsCancelExport.Text      = LanguageClass.Instance().GetString("CANCEL_READING");

            hsSaveSQL.Text      = LanguageClass.Instance().GetString("SAVE_SQL");
            hsLoadSQL.Text      = LanguageClass.Instance().GetString("LOAD_SQL");
            hsRunStatement.Text = LanguageClass.Instance().GetString("EXECUTE_SQL");

            hsRefreshExportData.Text   = LanguageClass.Instance().GetString("REFRESH");
            rbINSERT.Text              = LanguageClass.Instance().GetString("INSERT");
            rbUPDATE.Text              = LanguageClass.Instance().GetString("UPDATE");
            rbINSERTUPDATE.Text        = LanguageClass.Instance().GetString("INSERT_UPDATE");
            tabPageFIELDS.Text         = LanguageClass.Instance().GetString("FIELDS");
            tabPageDATA.Text           = LanguageClass.Instance().GetString("DATA");
            tabPageDependenciesTo.Text = LanguageClass.Instance().GetString("DEPENDENCIES_TO");

            tabPageExport.Text    = LanguageClass.Instance().GetString("EXPORT_DATA");
            tabPageMessages.Text  = LanguageClass.Instance().GetString("MESSAGES");
            gbMaxRows.Text        = LanguageClass.Instance().GetString("MAX_ROWS");
            cbExportToScreen.Text = LanguageClass.Instance().GetString("EXPORT_TO_SCREEN");
            cbExportToFile.Text   = LanguageClass.Instance().GetString("EXPORT_TO_FILE");
            gbExportFile.Text     = LanguageClass.Instance().GetString("FILE");
            gbInsertUpdate.Text   = LanguageClass.Instance().GetString("INSERT_UPDATE_TYPE");
        }
Exemple #5
0
        private void hsSaveSourceCodes_Click(object sender, EventArgs e)
        {
            var items = selDBObjects.CheckedItemDatas;

            pbExport.Minimum = 0;
            pbExport.Value   = 0;
            pbExport.Maximum = items.Count;
            if (ckDeleteOldSourceFiles.Checked)
            {
                string[] files = Directory.GetFiles(txtSourceCodePath.Text);
                foreach (string file in files)
                {
                    try
                    {
                        File.Delete($@"{file}");
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            var gsource = MakeGlobalCode();

            try
            {
                var fi = new FileInfo(txtSourceCodePath.Text + "\\DBGlobalFunctionsClass.cs");
                if (fi.Directory != null && fi.Directory.Exists)
                {
                    File.WriteAllText(txtSourceCodePath.Text + "\\DBGlobalFunctionsClass.cs", gsource);
                }
            }
            catch (Exception ex)
            {
                _localNotify?.AddToERROR(AppStaticFunctionsClass.GetFormattedError($@"hsSaveSourceCodes_Click", ex));
            }


            foreach (var itm in items)
            {
                var source = itm.Text.StartsWith("Cb") ? MakeCbSourceCode(itm.Object) : MakeSourceCode(itm.Object);

                try
                {
                    var fi = new FileInfo(txtSourceCodePath.Text + "\\" + itm.Text + "Class.cs");
                    if (fi.Directory != null && fi.Directory.Exists)
                    {
                        File.WriteAllText(txtSourceCodePath.Text + "\\" + itm.Text + "Class.cs", source);
                    }
                }
                catch (Exception ex)
                {
                    _localNotify?.AddToERROR(AppStaticFunctionsClass.GetFormattedError($@"hsSaveSourceCodes_Click", ex));
                }

                pbExport.Value++;
                gbExportProgress.Text = LanguageClass.Instance().GetString("PROGRESS") + $@" ({pbExport.Value}/{pbExport.Maximum})";
                Application.DoEvents();
            }
        }
Exemple #6
0
        public void RefreshLanguageText()
        {
            lblTableName.Text = LanguageClass.Instance().GetString("EVENTS_TRACKING");

            this.Text           = DevelopmentClass.Instance().GetDBInfo(_dbReg, LanguageClass.Instance().GetString("EVENTS_TRACKING"));
            hsSaveTRACKING.Text = LanguageClass.Instance().GetString("SAVE_TRACKING");
            hsLoadTRACKING.Text = LanguageClass.Instance().GetString("LOAD_TRACKING");
        }
Exemple #7
0
        private void LanguageChanged()
        {
            gbFoundLines.Text = LanguageClass.Instance().GetString("FoundLines");
            gbSearchCode.Text = LanguageClass.Instance().GetString("SEARCH");

            tabPageObjects.Text = LanguageClass.Instance().GetString("OBJECTS");
            tabPageOptions.Text = LanguageClass.Instance().GetString("SETTINGS");
        }
Exemple #8
0
 private void InfoRaised(object sender, MessageEventArgs k)
 {
     fctMessages.CurrentLineColor = Color.Blue;
     fctMessages.AppendText(k.Meldung);
     _messagesCount++;
     fctMessages.ScrollLeft();
     tabPageMessages.Text = Format(LanguageClass.Instance().GetString("MESSAGES_INFO_ERROR"), _messagesCount, _errorCount);
 }
Exemple #9
0
 public void RefreshLanguage()
 {
     tsmiUtilities.Text     = LanguageClass.Instance().GetString("UTILITIES");
     tsmiNotifications.Text = LanguageClass.Instance().GetString("NOTIFICATIONS") + @" (" + (_errors + _notifications).ToString() + @")";
     tsmiShowWindows.Text   = LanguageClass.Instance().GetString("SHOWWINDOWS");
     tsmiErrors.Text        = LanguageClass.Instance().GetString("ERRORS") + @" (" + (_errors).ToString() + @")";
     Refresh();
 }
Exemple #10
0
        public DatabaseCompareFrom(Form parent, DBRegistrationClass reg)
        {
            InitializeComponent();
            MdiParent = parent;
            _dbReg    = reg;

            LanguageClass.Instance().OnRaiseLanguageChangedHandler += LanguageChanged;
        }
Exemple #11
0
 private void contextMenuStrip2_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem == tsmiDesignEarth)
     {
         var pc = new ProgressClockForm(this)
         {
             X = 50,
             Y = 200
         };
         pc.Show();
     }
     else if (e.ClickedItem == tsmiDesign)
     {
         AppDesign = ReloadDesign(eColorDesigns.Gray);
     }
     else if (e.ClickedItem == tsmiAppSettings)
     {
         var af = new AppSettingsForm(this);
         af.Show();
     }
     else if (e.ClickedItem == tsmiDatabaseDesign)
     {
         DatabaseDesignForm.Instance().SetParent(MdiParent);
         DatabaseDesignForm.Instance().Show();
     }
     else if (e.ClickedItem == tsmiCreateUUID)
     {
         var uuid = new UUIDForm(MdiParent);
         uuid.Show();
     }
     else if (e.ClickedItem == tsmiScripting)
     {
         var dbReg = new DBRegistrationClass();
         var dbm   = new ScriptingForm(dbReg);
         dbm.Show();
     }
     else if (e.ClickedItem == tsmiDatabasRegistration)
     {
         var cfg = new DatabaseConfigForm(Instance(), ActRegistrationObject)
         {
             Cloned = false
         };
         cfg.SetBearbeitenMode(EditStateClass.eBearbeiten.eEdit);
         cfg.Show();
     }
     else if (e.ClickedItem == tsmiGerman)
     {
         LanguageClass.Instance().ChangeLanguage(LanguageClass.German);
     }
     else if (e.ClickedItem == tsmiEnglish)
     {
         LanguageClass.Instance().ChangeLanguage(LanguageClass.English);
     }
     else if (e.ClickedItem == tsmiJapanese)
     {
         LanguageClass.Instance().ChangeLanguage(LanguageClass.Japanese);
     }
 }
Exemple #12
0
 private void FBXpertMainForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     FormOnClosing = true;
     //CopyrightForm.Instance().Close();
     //DbExplorerForm.Instance().Close();
     DatabaseDefinitions.Instance().SerializeCurrent("Definition data changed");
     LanguageClass.Instance().OnRaiseLanguageChangedHandler -= FBXpertMainForm_OnRaiseLanguageChangedHandler;
     Application.Exit();
 }
Exemple #13
0
 public XmlDesignForm(Form parent, DBRegistrationClass reg)
 {
     InitializeComponent();
     MdiParent = parent;
     _dbReg    = reg;
     _localNotify.Notify.OnRaiseInfoHandler  += InfoRaised;
     _localNotify.Notify.OnRaiseErrorHandler += ErrorRaised;
     LanguageClass.Instance().OnRaiseLanguageChangedHandler += LanguageChanged;
 }
Exemple #14
0
        private void ErrorRaised(object sender, MessageEventArgs k)
        {
            fctMessages.CurrentLineColor = Color.Red;
            fctMessages.AppendText(k.Meldung);
            _errorCount++;
            fctMessages.ScrollLeft();

            object[] param = { _messagesCount, _errorCount };
            tabPageMessages.Text = LanguageClass.Instance().GetString("MESSAGES_INFO_ERROR", param);
        }
Exemple #15
0
        public HarpSlotsForm()
        {
            InitializeComponent();

            sharedFolder = $@"{Application.StartupPath}\temp\";


            FormInstances.Instance().HarpNotifies.Register4Info(NotifyInfoHandler);
            LanguageClass.Instance().RegisterChangeNotifiy(languageChanged);
        }
Exemple #16
0
 private void ChangeLanguage_click(object sender, EventArgs e)
 {
     if (sender == deutschToolStripMenuItem)
     {
         LanguageClass.Instance().ChangeLanguage("de");
     }
     else if (sender == englischToolStripMenuItem)
     {
         LanguageClass.Instance().ChangeLanguage("en");
     }
 }
Exemple #17
0
        private void hsClearMessages_Click(object sender, EventArgs e)
        {
            fctMessages.Clear();
            messages_count = 0;
            error_count    = 0;
            var sb = new StringBuilder();

            sb.Append($@"{LanguageClass.Instance().GetString("MESSAGES")} ({messages_count}) ");
            sb.Append($@"{LanguageClass.Instance().GetString("ERRORS")} ({error_count})");
            tabPageMessages.Text = sb.ToString();
        }
        private void hsLoad_Click(object sender, EventArgs e)
        {
            openFileDialog1.DefaultExt = "*.fdb";
            openFileDialog1.Filter     = @"Firebird DB|*.fdb|All|*.*";
            openFileDialog1.Title      = LanguageClass.Instance().GetString("SELECT_DATABSE");

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                txtLocation.Text = openFileDialog1.FileName;
            }
        }
Exemple #19
0
 private void LanguageChanged()
 {
     gbExportProgress.Text  = LanguageClass.Instance().GetString("PROGRESS");
     hsSaveSourceCodes.Text = LanguageClass.Instance().GetString("CreateSourcecode");
     gbSourceCode.Text      = LanguageClass.Instance().GetString("SourcecodePath");
     gbFoundLines.Text      = LanguageClass.Instance().GetString("FoundLines");
     gbSearchCode.Text      = LanguageClass.Instance().GetString("SEARCH");
     object[] param = { _messagesCount, _errorCount };
     tabPageMessages.Text         = LanguageClass.Instance().GetString("MESSAGES_INFO_ERROR", param);
     tabPageCreateAttributes.Text = LanguageClass.Instance().GetString("SETTINGS");
     hsClearMessages.Text         = LanguageClass.Instance().GetString("CLEAR_ENTRIES");
 }
Exemple #20
0
 public static CopyrightForm Instance(Form parent)
 {
     if (_instance != null)
     {
         return(_instance);
     }
     _instance = new CopyrightForm
     {
         MdiParent = parent
     };
     LanguageClass.Instance().OnRaiseLanguageChangedHandler += CopyrightForm_OnRaiseLanguageChangedHandler;
     return(_instance);
 }
Exemple #21
0
 void InfoRaised(object sender, MessageEventArgs k)
 {
     if (k.Key.ToString() == "CLEAR_NOTIFIES")
     {
         _notifications = 0;
     }
     else
     {
         _notifications++;
     }
     tsmiNotifications.Text = LanguageClass.Instance().GetString("NOTIFICATIONS") + @" (" + (_errors + _notifications).ToString() + @")";
     tsmiNotes.Text         = LanguageClass.Instance().GetString("NOTES") + @" (" + (_notifications).ToString() + @")";
 }
Exemple #22
0
        private void AppMainForm_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;

            this.Visible = true;
            this.LayoutMdi(System.Windows.Forms.MdiLayout.ArrangeIcons);

            Assembly asb = System.Reflection.Assembly.GetExecutingAssembly();

            AppName    = asb.GetName().ToString().Split(',')[0];
            AppVersion = asb.GetName().Version.ToString();
            string nm = asb.GetName().Name;

            object[] cp = asb.GetCustomAttributes(true);
            s = (AssemblyCompanyAttribute)cp[6];

            LanguageClass.Instance().InitEmbedded(this.GetType().Assembly, "HarpMeNow", "LanguageResource", "_", SelectedClass.Instance().Culture, LanguageClass.English);
            LanguageClass.Instance().ChangeLanguage(SelectedClass.Instance().Culture);
            SetLanguageControls();
            FormInstances.Create(this);
            FormInstances.Instance().LoadHarps();


            FormInstances.Instance().soundAttributeForm.Show();
            FormInstances.Instance().soundAttributeForm.SendToBack();
            FormInstances.Instance().harpSlotsForm.Show();
            FormInstances.Instance().harpSlotsForm.SendToBack();
            FormInstances.Instance().songSequenceForm.Show();
            FormInstances.Instance().songSequenceForm.SendToBack();
            FormInstances.Instance().harpSequenceForm.Show();
            FormInstances.Instance().harpSequenceForm.SendToBack();
            FormInstances.Instance().harpPlayForm.Show();
            FormInstances.Instance().harpPlayForm.SendToBack();

            FormInstances.Instance().harpPlayForm.Top = FormInstances.Instance().harpSlotsForm.Top;
            FormInstances.Instance().harpPlayForm.Left = FormInstances.Instance().harpSlotsForm.Left + FormInstances.Instance().harpSlotsForm.Width + 16;
            FormInstances.Instance().harpPlayForm.Height = FormInstances.Instance().harpSlotsForm.Height;
            FormInstances.Instance().songSequenceForm.Top = FormInstances.Instance().harpSlotsForm.Top + FormInstances.Instance().harpSlotsForm.Height + 16;
            FormInstances.Instance().songSequenceForm.Left = FormInstances.Instance().harpSlotsForm.Left;
            FormInstances.Instance().harpSequenceForm.Top = FormInstances.Instance().harpSlotsForm.Top + FormInstances.Instance().harpSlotsForm.Height + 16;
            FormInstances.Instance().harpSequenceForm.Left = FormInstances.Instance().songSequenceForm.Left + FormInstances.Instance().songSequenceForm.Width + 16;
            FormInstances.Instance().soundAttributeForm.Top = FormInstances.Instance().harpSequenceForm.Top;
            FormInstances.Instance().soundAttributeForm.Left = FormInstances.Instance().harpSequenceForm.Left + FormInstances.Instance().harpSequenceForm.Width + 16;

            this.WindowState = FormWindowState.Maximized;
            var cf = FBXInfo.Instance(this);

            cf.MdiParent = this;
            cf.Show();
            SetPositions();
        }
        private void hsLoadClientLib_Click(object sender, EventArgs e)
        {
            openFileDialog1.DefaultExt       = "*.dll";
            openFileDialog1.Filter           = "DLL|*.dll|All|*.*";
            openFileDialog1.Title            = LanguageClass.Instance().GetString("CHOOSE_CLIENT_LIBRARY");
            openFileDialog1.InitialDirectory = Application.StartupPath;
            if (openFileDialog1.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            FileInfo fi = new FileInfo(openFileDialog1.FileName);

            txtClientLibrary.Text = fi.FullName;
        }
Exemple #24
0
        private void hsCreateCVS_Click(object sender, EventArgs e)
        {
            var items = selDBObjects.CheckedItemDatas;

            pbExport.Minimum = 0;
            pbExport.Value   = 0;
            pbExport.Maximum = items.Count;
            var sb = new StringBuilder();

            sb.Append($@"DBNAME;LINKTYPE;LINKART;OBJTYPE_A;OBJ_A;OBJ_A_FIELD;OBJTYPE_B;OBJ_B;OBJ_B_FIELD;STAT;NR{Environment.NewLine}");
            int    n      = 0;
            string dbname = _dbReg.Alias.Replace(" ", "_");

            foreach (var itm in items)
            {
                if (itm.Object.GetType() == typeof(TableClass) && (!itm.Text.StartsWith("Cb")))
                {
                    var obj = (TableClass)itm.Object;
                    foreach (var field in obj.Fields)
                    {
                        if (field.Value.Name.EndsWith("_ID"))
                        {
                            string tabname = field.Value.Name.Substring(0, field.Value.Name.Length - 3);
                            sb.Append($@"{dbname};LOGICAL;TT;TABLE;{tabname};ID;TABLE;{obj.Name};{field.Value.Name};1;{n++}{Environment.NewLine}");
                        }
                    }
                }
                else if (itm.Object.GetType() == typeof(ViewClass) && (!itm.Text.StartsWith("Cb")))
                {
                    var obj = (ViewClass)itm.Object;
                    foreach (var field in obj.Fields)
                    {
                        if (field.Value.Name.EndsWith("__ID"))
                        {
                            string tabname = field.Value.Name.Substring(0, field.Value.Name.Length - 4);
                            sb.Append($@"{dbname};LOGICAL;TV;TABLE;{tabname};ID;VIEW;{obj.Name};{field.Value.Name};2;{n++}{Environment.NewLine}");
                        }
                    }
                }


                pbExport.Value++;
                gbExportProgress.Text = LanguageClass.Instance().GetString("PROGRESS") + $@" ({pbExport.Value}/{pbExport.Maximum})";
                Application.DoEvents();
            }
            fctSource.Text = sb.ToString();
        }
Exemple #25
0
        void MeldungRaised(object sender, MessageEventArgs k)
        {
            fctMessages.CurrentLineColor = System.Drawing.Color.Blue;
            fctMessages.AppendText(k.Meldung);
            var sb = new StringBuilder();

            messages_count++;
            if (messages_count > 0)
            {
                sb.Append($@"{LanguageClass.Instance().GetString("MESSAGES")} ({messages_count}) ");
            }
            if (error_count > 0)
            {
                sb.Append($@"{LanguageClass.Instance().GetString("ERRORS")} ({error_count})");
            }
            tabPageMessages.Text = sb.ToString();
            fctMessages.ScrollLeft();
        }
Exemple #26
0
 public void SetLanguageControls()
 {
     hsCloseApp.Text = LanguageClass.Instance().GetString("Close");
 }
Exemple #27
0
 public SongSequenceForm()
 {
     InitializeComponent();
     LanguageClass.Instance().RegisterChangeNotifiy(languageChanged);
 }
Exemple #28
0
 void ErrorRaised(object sender, MessageEventArgs k)
 {
     _errors++;
     tsmiNotifications.Text = LanguageClass.Instance().GetString("NOTIFICATIONS") + @" (" + (_errors + _notifications).ToString() + @")";
     tsmiErrors.Text        = LanguageClass.Instance().GetString("ERRORS") + @" (" + (_errors).ToString() + @")";
 }
Exemple #29
0
        public SoundAttributesForm()
        {
            InitializeComponent();

            LanguageClass.Instance().RegisterChangeNotifiy(languageChanged);
        }
Exemple #30
0
        //NotifyClass NotifyHandler;

        public AppMainForm()
        {
            InitializeComponent();

            LanguageClass.Instance().RegisterChangeNotifiy(languageChanged);
        }