-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring #3
base: master
Are you sure you want to change the base?
Refactoring #3
Conversation
Widely used global API method: LanguagesResourceManager.GetString(name, culture) shortened to: GetString(name) and all occurences of the method across the project replaced with the new one.
Widely used: MessageBox.Show(text, caption, buttons, icon, defaultButton, options); shortened to: QuickMessageBox.ShowX(text) where X represents type of the message (information, question, warning, or error) and all occurences of the method across the project replaced with the new one.
- API global class divided into more particular classes: App, Database, and Language. - API folder organized into sub-folders: Core and UI Elements. - All calls to API properties and methods across the project are renamed accordingly.
I can see that you kinda liked the app 😁 , this app is really old, like maybe 5 or 6 years ago haha, but anyway, i'm glad you enjoy playing with the code & refactoring it. Let me know when you finish refactoring so i merge all the changes at once! (this way you can still push new commits to this PR). |
- (Language.GetCurrentLanguage() == "ar") shortened to: (Language.IsArabic) - All occurences of the expression replaced with the new one.
API database method FetchAllTables decoupled from UI ToolStripStatuslabel parameter. now the ToolStripStatuslabel is set within the main form logic.
Statement (DateTime.Now.ToString().Replace("/", "-").Replace(":", "-").Replace(" ", "_")) replaced with (DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss")) in all occurences in project.
Now changing current culture, setting message boxes reading direction, and saving language to database is done through one method only.
- Added available languages resources files detection. - Added support for more than two languages. - Added language menu-item sub-items auto-generation from available languages resources files (Adding a new language resource file will auto-add that language to application with no need for further setup which gives better support for adding more new translations). - Added japanese language resource file.
- Added invariant general language resource file for the generation of strongly-typed class that allows access to localized strings through class properties instead of the non-typed GetString method of ResourceManager. - All GetString calls in project replaced accordinly.
- As it's not really related to Form_Main, LanguageChanged moved to API class, and now to subscribe to the event, no more need to call an instance of Form_Main every time. - All event subscription logic in project replaced accordinly.
- Removed API Forms Tracking Boolean Properties. - Now single form opening is checked through form instances properties.
- API code shortened using data access layer classes. - Now DataTables can be accessed directly through API properties using a wrapper data access class. - All occurences in project replaced accordingly. - Some bugs need to be fixed (To do for next commit).
- Database tables and columns renamed to english. - All references to databae tables and columns names replaced accordingly. - Data folder (database file and assets folder) added to project tree. - Added post build event to copy data folder to output folder. - Fixed some bugs (More to fix in next commit)
Runtime exceptions fixed, now the app can run :D - The table "Language" name is a reserved word in access database, it caused errors in the DataAdapter object trying to run the generated SQL commands. Renaming it to "CurrentLanguage" fixed the errors. - Renamed some forgotten references to the old names of the renamed database fields that caused exceptions when loading some forms.
[Forms refactoring work in progression] - Job and Help forms refactored. Some API methods added or updated due to form refactoring needs. - Added GetRows and HasRows methods in TableAccessor class of Database API. - Expression in refactored forms replaced accordingly.
[Forms refactoring work in progression] - AddCustomer form refactored. - Added Assets API class for better control over the creation of assets folders and files. - API path properties (Database & Assets paths) placed in their respective API classes (Database & Assets). - Removed AppFolderPath property becuase it's not needed as the paths are natively resolved in a relative way (to the current app executable folder path). - References affected by changes in project replaced accordingly.
[Forms refactoring work in progression] - AddCustomer form refactored. - CustomersList form refactored. - SearchCustomer form refactored. - Job and Help forms refactored. - Added DataTableNavigator utility class. - Added DataGridViewColumnFormat utility class.
[Forms refactoring work in progression] EditCustomer form sucks >:-(
Dude, that's a lot of work/refactoring! 😲 "ma3yitish? xD" |
Hello, I was working on this during holidays, it was fun 💃. but the holidays are done, and I couldn't find time to finish it. well, I think commits up to "🌏👽🚀 kawkab zo7al hal min tar7ib!?" |
Changes so far: