{"id":15572644,"url":"https://github.com/mikemajesty/coolvalidator","last_synced_at":"2025-04-24T00:43:08.452Z","repository":{"id":83483551,"uuid":"71580341","full_name":"mikemajesty/coolvalidator","owner":"mikemajesty","description":"Library  -  TextBox and object validator | C# Windows Form.","archived":false,"fork":false,"pushed_at":"2018-02-06T15:00:26.000Z","size":83,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T12:38:55.216Z","etag":null,"topics":["textbox","validate","validatemanytextbox","validatetexbox"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikemajesty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-21T16:01:01.000Z","updated_at":"2023-12-11T08:45:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"de1e6310-3d83-471e-8be2-346ee1f269ec","html_url":"https://github.com/mikemajesty/coolvalidator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemajesty%2Fcoolvalidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemajesty%2Fcoolvalidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemajesty%2Fcoolvalidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikemajesty%2Fcoolvalidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikemajesty","download_url":"https://codeload.github.com/mikemajesty/coolvalidator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250540939,"owners_count":21447426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["textbox","validate","validatemanytextbox","validatetexbox"],"created_at":"2024-10-02T18:04:11.487Z","updated_at":"2025-04-24T00:43:08.440Z","avatar_url":"https://github.com/mikemajesty.png","language":"C#","readme":"# CoolValidator - Validate TexBox now is easy\n\n## How to install\n```\n  Install-Package coolvalidator\n```\n\n## How to use\n#### Namespace\n```\n  using CoolValidator;\n```\n\n## Validate TextBox \n___ \n\n#### Default validator\n```C#\n  private void btnSave(object sender, EventArgs e)\n  {\n      this.ValidateTextBox(ValidateType.IS_EMPTY, PostValidate);\n  }\n\n  private void PostValidate()\n  {\n      MessageBox.Show(\"Field is Required\");\n  }\n```\n\u003cul\u003e\n\u003cli\u003e\u003cb\u003e ValidateType.IS_EMPTY\u003c/b\u003e - Verify if the TextBox is empty\u003c/li\u003e\n\u003cli\u003e\u003cb\u003ePosValidateAction\u003c/b\u003e - The method that will run after validation\u003c/li\u003e\n\u003c/ul\u003e\n\n___\n\n#### Custom validator\n\n```C#\n  private void btnSave(object sender, EventArgs e)\n  {\n      this.ValidateTextBox(ValidateType.NONE, PostValidate, c =\u003e\n                  string.IsNullOrEmpty(c.Text) \u0026\u0026 c.Tag.Equals(\"Required\"));\n  }\n\n  private void PostValidate()\n  {\n      MessageBox.Show(\"Field is Required\");\n  }\n``` \n\n\u003cul\u003e\n\u003cli\u003e\u003cb\u003eValidateType.NONE\u003c/b\u003e - Indicate that none validate it will be executed\u003c/li\u003e\n\u003cli\u003e\u003cb\u003ePosValidateAction\u003c/b\u003e - The method that will run after validation\u003c/li\u003e\n\u003cli\u003e\u003cb\u003ec =\u003e string.IsNullOrEmpty(c.Text) \u0026\u0026 c.Tag.Equals(\"Required\")\u003c/b\u003e - Condition to validate a TextBox, you can put anything.\u003c/li\u003e\n\u003c/ul\u003e\n\nTo validate the example above it's necessary that TextBox be empty and its Tag property be \"Required\"\n\n[![required.png](https://s17.postimg.org/sxllw9n1r/required.png)](https://postimg.org/image/s82tjwmi3/)\n\n#### Custom and default validator\n```C#\n  private void btnSave(object sender, EventArgs e)\n  {\n      this.ValidateTextBox(ValidateType.IS_EMPTY, PostValidate, c =\u003e\n                                          c.Tag.Equals(\"Required\"));\n  }\n\n  private void PostValidate()\n  {\n      MessageBox.Show(\"Field is Required\");\n  }\n```\n\u003cul\u003e\n\u003cli\u003e\u003cb\u003eValidateType.IS_EMPTY\u003c/b\u003e - Varify if the TextBox is empty\u003c/li\u003e\n\u003cli\u003e\u003cb\u003ePosValidateAction\u003c/b\u003e - The method that will run after validation\u003c/li\u003e\n\u003cli\u003e\u003cb\u003ec =\u003e c.Tag.Equals(\"Required\")\u003c/b\u003e - Condition to validate a TextBox, you can put anything.\u003c/li\u003e\n\u003c/ul\u003e\n\n___\n## Validate Entity\n___\n\n#### Firstly you must create a class with Annotation, example\n\n[![productClass.png](https://s13.postimg.org/evu7xzbpj/product_Class.png)](https://postimg.org/image/ceigqprsz/)\n\nTo validate your entity use \n\n[![validaTxtInFormPNG.png](https://s13.postimg.org/u4p78vbpj/valida_Txt_In_Form_PNG.png)](https://postimg.org/image/t2f0qbsw3/)\n\nIn the example above we took in the first error a list of possible errors, The error list is composed of\n\n[![errorClass.png](https://s13.postimg.org/z0ns3g5jb/error_Class.png)](https://postimg.org/image/yb4zr34zn/)\n\nThen we showed the error in a MessageBox\n\n[![warning.png](https://s13.postimg.org/5cpl1muiv/warning.png)](https://postimg.org/image/k8o4985xf/)\n\nYou can do whatever you want with these error messages, make yourself comfortable\n\n\u003chr\u003e\n\n### License\n\nIt is available under the MIT license.\n[License](https://opensource.org/licenses/mit-license.php)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikemajesty%2Fcoolvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikemajesty%2Fcoolvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikemajesty%2Fcoolvalidator/lists"}