{"id":109,"date":"2016-02-17T14:45:05","date_gmt":"2016-02-17T14:45:05","guid":{"rendered":"https:\/\/ibex.tech\/csharp\/?p=109"},"modified":"2022-02-17T06:24:15","modified_gmt":"2022-02-17T06:24:15","slug":"create-a-new-class","status":"publish","type":"post","link":"https:\/\/ibex.tech\/csharp\/c-sharp\/classes\/create-a-new-class","title":{"rendered":"Create A New Class"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Creating a new class<\/h4>\n\n\n\n<p>Project &gt; Add Class<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">In the new .cs&nbsp;file add the following:<\/h5>\n\n\n\n<p>The namespace can be a distinct name, or for classes that are part of a main ap you can just use the ap\u2019s namespace name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\n\/\/----- NOTES -----\n\/\/\n\/\/USING THIS CLASS IN A PROJECT:-\n\/*\n\/\/USING NAMESPACES\n\tusing OurLibraries;\n\/\/IN YOUR DECLARATIONS:\n\tprivate MyClass MyClass1;\n\/\/IN YOUR CONSTRUCTOR\n\tMyClass1 = new MyClass();\n\/\/START USING\n\tMyClass1.#();\n*\/\n\nnamespace OurLibraries\n{\n\tclass MyClass\n\t{\n\t\t\/\/--------------------------\n\t\t\/\/----- PUBLIC DEFINES -----\n\t\t\/\/--------------------------\n\t\t\/\/public \n\n\n\t\t\/\/---------------------------\n\t\t\/\/----- PRIVATE DEFINES -----\n\t\t\/\/---------------------------\n\t\t\/\/private \n\n\n\t\t\/\/--------------------------\n\t\t\/\/----- PUBLIC OBJECTS -----\n\t\t\/\/--------------------------\n\t\t\/\/public \n\n\t\n\t\t\/\/---------------------------\n\t\t\/\/----- PRIVATE OBJECTS -----\n\t\t\/\/---------------------------\n\t\t\/\/private \n\n\t\t\n\t\t\/\/*********************************\n\t\t\/\/*********************************\n\t\t\/\/********** CONSTRUCTOR **********\n\t\t\/\/*********************************\n\t\t\/\/*********************************\n\t\tpublic MyClass()\n\t\t{\n\t\t\t\n\t\t}\n\n\n\t}\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a new class Project &gt; Add Class In the new .cs&nbsp;file add the following: The namespace can be a distinct name, or for classes that are part of a main ap you can just use the ap\u2019s namespace name.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-109","post","type-post","status-publish","format-standard","hentry","category-classes"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/comments?post=109"}],"version-history":[{"count":5,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":425,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/posts\/109\/revisions\/425"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/media?parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/categories?post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/csharp\/wp-json\/wp\/v2\/tags?post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}