{"id":913,"date":"2009-09-22T09:16:49","date_gmt":"2009-09-22T08:16:49","guid":{"rendered":"http:\/\/soci.hu\/blog\/?p=913"},"modified":"2009-10-06T08:05:05","modified_gmt":"2009-10-06T07:05:05","slug":"resharper","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2009\/09\/22\/resharper\/","title":{"rendered":"Resharper"},"content":{"rendered":"<p>A k\u00f6vetkez\u0151 n\u00e9h\u00e1ny h\u00f3napban egy rakat .NET oktat\u00e1st tartok egy c\u00e9gnek Marcell j\u00f3volt\u00e1b\u00f3l (ez\u00fattal is k\u00f6sz\u00f6n\u00f6m neki az \u00fczletet).<br \/>\nA c\u00e9gn\u00e9l szabv\u00e1nyos\u00edtani fogj\u00e1k a <a href=\"http:\/\/www.jetbrains.com\/resharper\/download\/\">Resharper<\/a>t, egy VS kieg\u00e9sz\u00edt\u0151 addint. T\u00f6bbsz\u00f6r felraktam m\u00e1r a g\u00e9pemre, de mindig levettem, mert ideges\u00edtett, hogy mindent \u00e1tszab a VS-ben. \u00c9n mindent shortcutokkal \u00e9rek el, azokra j\u00f3l r\u00e1\u00fcl, azt\u00e1n felj\u00f6n a saj\u00e1t fel\u00fclete. Ezzel az agyamra ment, sokat okoskodott, mindig leszedtem.<br \/>\nMost, hogy tanuljam, mire az oktat\u00e1s j\u00f6n, \u00fajra felraktam, \u00e9s haszn\u00e1lom nap mint nap. Telep\u00edt\u00e9s ut\u00e1n azt k\u00e9rtem t\u0151le, nem telepedjen r\u00e1 minden shortcutra, \u00edgy m\u00e1r eg\u00e9sz j\u00f3l megvagyunk.<br \/>\nAmi viszont igen kellemes meglepet\u00e9s volt, hogy m\u00e1r k\u00e9t hib\u00e1t is kisz\u00fart. Az egyikben egy param\u00e9ter \u00e9rt\u00e9k\u00e9t az ugyanolyan nev\u0171 mez\u0151be raktam bele, csak valahogy lemaradt a this. Trivi\u00e1lis hiba, de nem t\u0171nt fel a sok param\u00e9ter k\u00f6z\u00f6tt. A m\u00e1sik kicsit ravaszabb.<\/p>\n<p>Process[] p = Process.GetProcessesByName(&#8220;&#8230;&#8221;);<br \/>\nif (p == null) &#8230;<\/p>\n<p>Mi a hiba eben a k\u00f3dban? A resharper j\u00f3l kisz\u00farta, hogy az if kifejez\u00e9se mindig <del datetime=\"2009-10-06T07:04:50+00:00\">true<\/del> false. Mi\u00e9rt? \u00cdgy n\u00e9z ki a GetProcessesByName v\u00e9ge:<\/p>\n<p>Process[] array = new Process[list.Count];<br \/>\nlist.CopyTo(array, 0);<br \/>\nreturn array;<\/p>\n<p>Nulla hossz\u00fa t\u00f6mb j\u00f6n vissza, ha nincs ilyen nev\u0171 processz. Nem rak\u00e9tatudom\u00e1ny, m\u00e9gis k\u00f6nny\u0171 elrontani. A Resharper meg \u00e9szrevette. Megtartjuk, szeretj\u00fck.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A k\u00f6vetkez\u0151 n\u00e9h\u00e1ny h\u00f3napban egy rakat .NET oktat\u00e1st tartok egy c\u00e9gnek Marcell j\u00f3volt\u00e1b\u00f3l (ez\u00fattal is k\u00f6sz\u00f6n\u00f6m neki az \u00fczletet). A c\u00e9gn\u00e9l szabv\u00e1nyos\u00edtani&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,10,4],"tags":[],"class_list":["post-913","post","type-post","status-publish","format-standard","hentry","category-net","category-c","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=913"}],"version-history":[{"count":2,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/913\/revisions"}],"predecessor-version":[{"id":933,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/913\/revisions\/933"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}