{"id":146,"date":"2010-04-13T23:08:31","date_gmt":"2010-04-14T04:08:31","guid":{"rendered":"http:\/\/www.mageuzi.com\/blog\/?p=146"},"modified":"2010-04-13T23:08:31","modified_gmt":"2010-04-14T04:08:31","slug":"urlshorteningtextbox","status":"publish","type":"post","link":"http:\/\/www.mageuzi.com\/blog\/2010\/04\/13\/urlshorteningtextbox\/","title":{"rendered":"UrlShorteningTextBox"},"content":{"rendered":"<p>This is something I&#8217;ve been meaning to post for a while, but it kept slipping my mind.  In Trowl, one of the features is that the &#8220;New Tweet&#8221; box will automatically shorten any URLs you copy and paste into it.  It&#8217;s kind of a limited use case &#8212; I&#8217;m not sure how many apps out there need this ability &#8212; but I thought I&#8217;d post the code for anyone who might find it useful.<\/p>\n<p>It also demonstrates a few things, like how to capture the &#8220;paste&#8221; event in .NET, how to create your own events and how to inherit from .NET&#8217;s base controls.  So even if you don&#8217;t use the URL-shortening capability itself, perhaps it can be used for those things.<\/p>\n<p>The code is relatively straightforward, so I&#8217;m not going to go through it line-by-line. But I&#8217;d be happy to answer any questions &#8212; just leave a comment!  And, of course, I&#8217;m open to any suggestions :)<\/p>\n<p>Enjoy!<\/p>\n<p><img decoding=\"async\" src=\"\/images\/csharpicon.png\" align=\"middle\"> <a href=\"\/scratch\/UrlShorteningTextBox.cs\">UrlShorteningTextBox.cs<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is something I&#8217;ve been meaning to post for a while, but it kept slipping my mind. In Trowl, one of the features is that the &#8220;New Tweet&#8221; box will automatically shorten any URLs you copy and paste into it. It&#8217;s kind of a limited use case &#8212; I&#8217;m not sure how many apps out [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,33],"tags":[50,49,12],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/posts\/146"}],"collection":[{"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/comments?post=146"}],"version-history":[{"count":5,"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/posts\/146\/revisions"}],"predecessor-version":[{"id":151,"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/posts\/146\/revisions\/151"}],"wp:attachment":[{"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/media?parent=146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/categories?post=146"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mageuzi.com\/blog\/wp-json\/wp\/v2\/tags?post=146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}