<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zemna.Net &#187; C#</title>
	<atom:link href="http://www.zemna.net/archives/tag/c/feed" rel="self" type="application/rss+xml" />
	<link>http://www.zemna.net</link>
	<description>Enjoy Your Programming!</description>
	<lastBuildDate>Tue, 07 Sep 2010 01:25:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Extension 클래스를 통해 기존 클래스를 확장하기</title>
		<link>http://www.zemna.net/archives/132</link>
		<comments>http://www.zemna.net/archives/132#comments</comments>
		<pubDate>Thu, 25 Mar 2010 03:25:58 +0000</pubDate>
		<dc:creator>zemna</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Extension]]></category>

		<guid isPermaLink="false">http://www.zemna.net/133520</guid>
		<description><![CDATA[C# 3.0 에서부터 새로 제공되는 기능으로 Extensions 라는 것이 있다. 이 것은 기존에 정의되어 있는 클래스를 확장할 수 있도록 해주는 방법이라고 할 수 있다. 백문이 불여일견이니 어떻게 하는지 한번 살펴보도록 하겠다. 일단 먼저 기본으로 제공되는 String에 현재의 문자열의 길이를 리턴해주는 GetStringLength() 라는 함수를 제공하도록 해보겠다. 프로젝트를 하나 생성하고 StringExtensions 라는 이름의 클래스를 하나 추가한 후 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F132"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F132&amp;source=zemnanet&amp;style=normal&amp;service=TinyURL.com&amp;hashtags=.NET,C%23,Extension" height="61" width="50" /><br />
			</a>
		</div>
<p>C# 3.0 에서부터 새로 제공되는 기능으로 Extensions 라는 것이 있다.</p>
<p>이 것은 기존에 정의되어 있는 클래스를 확장할 수 있도록 해주는 방법이라고 할 수 있다. 백문이 불여일견이니 어떻게 하는지 한번 살펴보도록 하겠다.</p>
<p>일단 먼저 기본으로 제공되는 String에 현재의 문자열의 길이를 리턴해주는 GetStringLength() 라는 함수를 제공하도록 해보겠다.</p>
<p>프로젝트를 하나 생성하고 StringExtensions 라는 이름의 클래스를 하나 추가한 후 아래와 같이 코딩하도록 하자.</p>
<pre class="brush: csharp;">
namespace ExtensionMethodTest
{
    public static class StringExtensions
    {
        public static int GetTextLength(this string s)
        {
            return s.Length;
        }
    }
}
</pre>
<p>이와 같이 코딩한 후 폼을 하나 추가하고 폼에서 String 변수를 하나 생성해서 아래와 같이 코딩하도록 하자.</p>
<pre class="brush: csharp;">
using System;
using System.Windows.Forms;

namespace ExtensionMethodTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string message = &quot;Hello~~~~~&quot;;
            MessageBox.Show(message.GetTextLength().ToString());
        }
    }
}
</pre>
<p>위와 같이 string 함수에 위에서 정의한 함수가 확장되어 들어가 있는 것을 볼 수 있다.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.zemna.net/archives/132/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.zemna.net/archives/132&amp;title=Extension+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%86%B5%ED%95%B4+%EA%B8%B0%EC%A1%B4+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%99%95%EC%9E%A5%ED%95%98%EA%B8%B0" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.zemna.net/archives/132&amp;title=Extension+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%86%B5%ED%95%B4+%EA%B8%B0%EC%A1%B4+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%99%95%EC%9E%A5%ED%95%98%EA%B8%B0" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.zemna.net/archives/132&amp;title=Extension+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%86%B5%ED%95%B4+%EA%B8%B0%EC%A1%B4+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%99%95%EC%9E%A5%ED%95%98%EA%B8%B0&amp;desc=C%23%203.0%20%EC%97%90%EC%84%9C%EB%B6%80%ED%84%B0%20%EC%83%88%EB%A1%9C%20%EC%A0%9C%EA%B3%B5%EB%90%98%EB%8A%94%20%EA%B8%B0%EB%8A%A5%EC%9C%BC%EB%A1%9C%20Extensions%20%EB%9D%BC%EB%8A%94%20%EA%B2%83%EC%9D%B4%20%EC%9E%88%EB%8B%A4.%0D%0A%0D%0A%EC%9D%B4%20%EA%B2%83%EC%9D%80%20%EA%B8%B0%EC%A1%B4%EC%97%90%20%EC%A0%95%EC%9D%98%EB%90%98%EC%96%B4%20%EC%9E%88%EB%8A%94%20%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC%20%ED%99%95%EC%9E%A5%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%8F%84%EB%A1%9D%20%ED%95%B4%EC%A3%BC%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%B4%EB%9D%BC%EA%B3%A0%20%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%8B%A4.%20%EB%B0%B1%EB%AC%B8%EC%9D%B4%20%EB%B6%88%EC%97%AC%EC%9D%BC%EA%B2%AC%EC%9D%B4%EB%8B%88%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%ED%95%98%EB%8A%94%EC%A7%80%20%ED%95%9C%EB%B2%88%20%EC%82%B4%ED%8E%B4%EB%B3%B4%EB%8F%84%EB%A1%9D%20%ED%95%98%EA%B2%A0%EB%8B%A4.%0D%0A%0D%0A%EC%9D%BC%EB%8B" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.zemna.net/archives/132&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.zemna.net/archives/132&amp;bm_description=Extension+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%86%B5%ED%95%B4+%EA%B8%B0%EC%A1%B4+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%99%95%EC%9E%A5%ED%95%98%EA%B8%B0&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.zemna.net/archives/132&amp;title=Extension+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%86%B5%ED%95%B4+%EA%B8%B0%EC%A1%B4+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%99%95%EC%9E%A5%ED%95%98%EA%B8%B0" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.zemna.net/archives/132&amp;title=Extension+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%86%B5%ED%95%B4+%EA%B8%B0%EC%A1%B4+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%99%95%EC%9E%A5%ED%95%98%EA%B8%B0" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.zemna.net/archives/132" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Extension+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%86%B5%ED%95%B4+%EA%B8%B0%EC%A1%B4+%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC+%ED%99%95%EC%9E%A5%ED%95%98%EA%B8%B0+-+http://tinyurl.com/yk52bok&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.zemna.net/archives/132/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>바이너리(Binary) 파일 Read/Write 하기</title>
		<link>http://www.zemna.net/archives/160</link>
		<comments>http://www.zemna.net/archives/160#comments</comments>
		<pubDate>Thu, 18 Mar 2010 15:58:18 +0000</pubDate>
		<dc:creator>zemna</dc:creator>
				<category><![CDATA[.NET 일반]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Binary]]></category>
		<category><![CDATA[BinaryReader]]></category>
		<category><![CDATA[BinaryWriter]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.zemna.net/132363</guid>
		<description><![CDATA[.NET Framrwork에서는 바이너리(Binary) 파일을 읽고 쓰기위한 BinaryReader, BinaryWriter 클래스를 제공한다. 이 클래스를 이용하면 쉽게 파일을 읽고 쓸 수 있다. BinaryReader 를 이용한 파일 읽기 // 파일 열기 FileStream fs = File.OpenRead(&#34;a.bin&#34;); // 스트림을 이용하여 BinaryReader 클래스 생성하기 BinaryReader br = new BinaryReader(fs); // 파일 Read용 임시 변수 Int16 temp = 0; // 2바이트 읽기 temp [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F160"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F160&amp;source=zemnanet&amp;style=normal&amp;service=TinyURL.com&amp;hashtags=.NET,Binary,BinaryReader,BinaryWriter,C%23" height="61" width="50" /><br />
			</a>
		</div>
<p>.NET Framrwork에서는 바이너리(Binary) 파일을 읽고 쓰기위한 BinaryReader, BinaryWriter 클래스를 제공한다.</p>
<p>이 클래스를 이용하면 쉽게 파일을 읽고 쓸 수 있다.</p>
<h4><span style="color: #993300;">BinaryReader 를 이용한 파일 읽기</span></h4>
<pre class="brush: csharp;">
// 파일 열기
FileStream fs = File.OpenRead(&quot;a.bin&quot;);

// 스트림을 이용하여 BinaryReader 클래스 생성하기
BinaryReader br = new BinaryReader(fs);

// 파일 Read용 임시 변수
Int16 temp = 0;

// 2바이트 읽기
temp = br.ReadInt16();

// 60문자 만큼 스트링 읽기
String str = new String(br.ReadChars(60));

br.Close();
fs.Close();
</pre>
<h4><span style="color: #993300;">BinaryWriter 를 이용한 파일 쓰기</span></h4>
<pre class="brush: csharp;">

// 파일 생성
FileStream fs = File.Create(&quot;a.bin&quot;);

// 스트림을 이용하여 BinaryWriter 클래스 생성하기
BinaryWriter bw = new BinaryWriter(fs);

// 임시 변수
Int16 temp = 0;

// 2바이트 쓰기
bw.Write(temp);

bw.Close();
fs.Close();
</pre>
<p>이와 같이 쉽에 Read/Writer가 가능하다.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.zemna.net/archives/160/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.zemna.net/archives/160&amp;title=%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC%28Binary%29+%ED%8C%8C%EC%9D%BC+Read%2FWrite+%ED%95%98%EA%B8%B0" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.zemna.net/archives/160&amp;title=%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC%28Binary%29+%ED%8C%8C%EC%9D%BC+Read%2FWrite+%ED%95%98%EA%B8%B0" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.zemna.net/archives/160&amp;title=%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC%28Binary%29+%ED%8C%8C%EC%9D%BC+Read%2FWrite+%ED%95%98%EA%B8%B0&amp;desc=.NET%20Framrwork%EC%97%90%EC%84%9C%EB%8A%94%20%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC%28Binary%29%20%ED%8C%8C%EC%9D%BC%EC%9D%84%20%EC%9D%BD%EA%B3%A0%20%EC%93%B0%EA%B8%B0%EC%9C%84%ED%95%9C%20BinaryReader%2C%20BinaryWriter%20%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC%20%EC%A0%9C%EA%B3%B5%ED%95%9C%EB%8B%A4.%0D%0A%0D%0A%EC%9D%B4%20%ED%81%B4%EB%9E%98%EC%8A%A4%EB%A5%BC%20%EC%9D%B4%EC%9A%A9%ED%95%98%EB%A9%B4%20%EC%89%BD%EA%B2%8C%20%ED%8C%8C%EC%9D%BC%EC%9D%84%20%EC%9D%BD%EA%B3%A0%20%EC%93%B8%20%EC%88%98%20%EC%9E%88%EB%8B%A4.%0D%0ABinaryReader%20%EB%A5%BC%20%EC%9D%B4%EC%9A%A9%ED%95%9C%20%ED%8C%8C%EC%9D%BC%20%EC%9D%BD%EA%B8%B0%0D%0A%5Bcode%20lang%3D%22csharp%22%5D%0D%0A%2F%2F%20%ED%8C%8C%EC%9D%BC%20%EC%97%B4%EA%B8%B0%0D%0AFileStream%20fs%20%3D" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.zemna.net/archives/160&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.zemna.net/archives/160&amp;bm_description=%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC%28Binary%29+%ED%8C%8C%EC%9D%BC+Read%2FWrite+%ED%95%98%EA%B8%B0&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.zemna.net/archives/160&amp;title=%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC%28Binary%29+%ED%8C%8C%EC%9D%BC+Read%2FWrite+%ED%95%98%EA%B8%B0" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.zemna.net/archives/160&amp;title=%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC%28Binary%29+%ED%8C%8C%EC%9D%BC+Read%2FWrite+%ED%95%98%EA%B8%B0" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.zemna.net/archives/160" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=%EB%B0%94%EC%9D%B4%EB%84%88%EB%A6%AC%28Binary%29+%ED%8C%8C%EC%9D%BC+Read%2FWrite+%ED%95%98%EA%B8%B0+-+http://tinyurl.com/yj37z8r&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.zemna.net/archives/160/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generic List 복제하는 방법</title>
		<link>http://www.zemna.net/archives/158</link>
		<comments>http://www.zemna.net/archives/158#comments</comments>
		<pubDate>Thu, 18 Mar 2010 15:55:58 +0000</pubDate>
		<dc:creator>zemna</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.zemna.net/132633</guid>
		<description><![CDATA[클래스에서 Copy() 나 Clone() 함수를 제공하지 않아 For 문을 이용해서 대입해야 하는 줄 알았다&#8230; // Generic List 생성 List&#60;int&#62; a = new List&#60;int&#62;(); // 값 추가하기 a.Add(1); a.Add(2); a.Add(3); // List 복제하기 List&#60;int&#62; b = new List&#60;int&#62;(a); 위의 코드와 같이 생성할 List 템플릿의 생성자에 복제할 List 클래스의 인스턴스를 넘겨주면 복제가 된다. Subscribe to the comments [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F158"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F158&amp;source=zemnanet&amp;style=normal&amp;service=TinyURL.com&amp;hashtags=.NET,C%23" height="61" width="50" /><br />
			</a>
		</div>
<p>클래스에서 Copy() 나 Clone() 함수를 제공하지 않아 For 문을 이용해서 대입해야 하는 줄 알았다&#8230; <img src='http://www.zemna.net/wordpress/wp-includes/images/smilies/icon_cry.gif' alt=':cry:' class='wp-smiley' /> </p>
<pre class="brush: csharp;">

// Generic List 생성
List&lt;int&gt; a = new List&lt;int&gt;();

// 값 추가하기
a.Add(1);
a.Add(2);
a.Add(3);

// List 복제하기
List&lt;int&gt; b = new List&lt;int&gt;(a);
</pre>
<p>위의 코드와 같이 생성할 List 템플릿의 생성자에 복제할 List 클래스의 인스턴스를 넘겨주면 복제가 된다.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.zemna.net/archives/158/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.zemna.net/archives/158&amp;title=Generic+List%3C%3E+%EB%B3%B5%EC%A0%9C%ED%95%98%EB%8A%94+%EB%B0%A9%EB%B2%95" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.zemna.net/archives/158&amp;title=Generic+List%3C%3E+%EB%B3%B5%EC%A0%9C%ED%95%98%EB%8A%94+%EB%B0%A9%EB%B2%95" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.zemna.net/archives/158&amp;title=Generic+List%3C%3E+%EB%B3%B5%EC%A0%9C%ED%95%98%EB%8A%94+%EB%B0%A9%EB%B2%95&amp;desc=%ED%81%B4%EB%9E%98%EC%8A%A4%EC%97%90%EC%84%9C%20Copy%28%29%20%EB%82%98%20Clone%28%29%20%ED%95%A8%EC%88%98%EB%A5%BC%20%EC%A0%9C%EA%B3%B5%ED%95%98%EC%A7%80%20%EC%95%8A%EC%95%84%20For%20%EB%AC%B8%EC%9D%84%20%EC%9D%B4%EC%9A%A9%ED%95%B4%EC%84%9C%20%EB%8C%80%EC%9E%85%ED%95%B4%EC%95%BC%20%ED%95%98%EB%8A%94%20%EC%A4%84%20%EC%95%8C%EC%95%98%EB%8B%A4...%20%3Acry%3A%0D%0A%0D%0A%5Bcode%20lang%3D%22csharp%22%5D%0D%0A%0D%0A%2F%2F%20Generic%20List%20%EC%83%9D%EC%84%B1%0D%0AList%26lt%3Bint%26gt%3B%20a%20%3D%20new%20List%26lt%3Bint%26gt%3B%28%29%3B%0D%0A%0D%0A%2F%2F%20%EA%B0%92%20%EC%B6%94%EA%B0%80%ED%95%98%EA%B8%B0%0D%0Aa.Add%281%29%3B%0D%0Aa.Add%282%29%3B%0D%0Aa.Add%283%29%3B%0D%0A%0D%0A%2F%2F%20List%20%EB%B3%B5%EC%A0%9C%ED" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.zemna.net/archives/158&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.zemna.net/archives/158&amp;bm_description=Generic+List%3C%3E+%EB%B3%B5%EC%A0%9C%ED%95%98%EB%8A%94+%EB%B0%A9%EB%B2%95&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.zemna.net/archives/158&amp;title=Generic+List%3C%3E+%EB%B3%B5%EC%A0%9C%ED%95%98%EB%8A%94+%EB%B0%A9%EB%B2%95" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.zemna.net/archives/158&amp;title=Generic+List%3C%3E+%EB%B3%B5%EC%A0%9C%ED%95%98%EB%8A%94+%EB%B0%A9%EB%B2%95" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.zemna.net/archives/158" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Generic+List%3C%3E+%EB%B3%B5%EC%A0%9C%ED%95%98%EB%8A%94+%EB%B0%A9%EB%B2%95+-+http://tinyurl.com/ygucr9k&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.zemna.net/archives/158/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full-Screen Application</title>
		<link>http://www.zemna.net/archives/109</link>
		<comments>http://www.zemna.net/archives/109#comments</comments>
		<pubDate>Wed, 02 Dec 2009 03:59:55 +0000</pubDate>
		<dc:creator>zemna</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Full-Screen]]></category>

		<guid isPermaLink="false">http://www.zemna.net/134795</guid>
		<description><![CDATA[Yesterday I posted a quick update to an article I wrote back in 2007 entitled How to make a full-screen Windows app using VB.NET. Aside from 1 or 2 people saying “Oh man why don’t you be a man and write it using C#?” I reckon it’s a good idea to do that anyway. Thanks [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F109"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F109&amp;source=zemnanet&amp;style=normal&amp;service=TinyURL.com&amp;hashtags=C%23,Full-Screen" height="61" width="50" /><br />
			</a>
		</div>
<p>Yesterday I posted a quick update to an article I wrote back in 2007 entitled <a href="http://digitalformula.net/net-geekery/how-to-make-a-full-screen-windows-app-using-vbnet/" target="_blank">How to make a full-screen Windows app using VB.NET</a>. Aside from 1 or 2 people saying “Oh man why don’t you be a man and write it using C#?” I reckon it’s a good idea to do that anyway. Thanks Scott for the suggestion. <img class="wp-smiley" src="http://digitalformula.net/wp-includes/images/smilies/icon_wink.gif" alt=";)" /> And thanks <a href="http://www.philsversion.com/" target="_blank">Phil</a> for pointing me in the right direction with the DLL import stuff. <img class="wp-smiley" src="http://digitalformula.net/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>So, without any mucking about here’s the exact same complete application example only this time in C#. You can download the application’s source on the <a href="http://digitalformula.net/downloads/">Digital Formula Downloads</a> page or, alternatively, from the <a href="http://digitalformula.net/download/df_fullscreen_demo_cs.zip">application source’s direct link</a>. For those that want to see the main form’s complete source before they download, it can be found at the end of this article.</p>
<p>Please feel to ask any questions necessary. Thanks!</p>
<p>Form1’s complete source:</p>
<pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace Play
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        [DllImport (&quot;user32.dll&quot;)]
        private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndIntertAfter, int X, int Y, int cx, int cy, int uFlags);
        [DllImport(&quot;user32.dll&quot;)]
        private static extern int GetSystemMetrics(int Which);

        private const int SM_CXSCREEN = 0;
        private const int SM_CYSCREEN = 1;
        private IntPtr HWND_TOP = IntPtr.Zero;
        private const int SWP_SHOWWINDOW = 64;

        public int ScreenX
        {
            get
            {
                return GetSystemMetrics(SM_CXSCREEN);
            }
        }

        public int ScreenY
        {
            get
            {
                return GetSystemMetrics(SM_CYSCREEN);
            }
        }

        private void FullScreen()
        {
            this.WindowState = FormWindowState.Maximized;
            this.FormBorderStyle = FormBorderStyle.None;
            this.TopMost = true;
            SetWindowPos(this.Handle, HWND_TOP, 0, 0, ScreenX, ScreenY, SWP_SHOWWINDOW);
        }

        private void Restore()
        {
            this.WindowState = FormWindowState.Normal;
            this.FormBorderStyle = FormBorderStyle.SizableToolWindow;
            this.TopMost = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            FullScreen();
        }

        private void cmdRestore_Click(object sender, EventArgs e)
        {
            Restore();
        }

        private void cmdExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
</pre>
<address>출처 : <a href="http://digitalformula.net/development/c-full-screen-application-complete-application-example/" target="_blank">http://digitalformula.net/development/c-full-screen-application-complete-application-example/</a></address>
<address>
</address>
<address>
</address>
<address> </address>
<address> </address>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.zemna.net/archives/109/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.zemna.net/archives/109&amp;title=Full-Screen+Application" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.zemna.net/archives/109&amp;title=Full-Screen+Application" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.zemna.net/archives/109&amp;title=Full-Screen+Application&amp;desc=Yesterday%20I%20posted%20a%20quick%20update%20to%20an%20article%20I%20wrote%20back%20in%202007%20entitled%20How%20to%20make%20a%20full-screen%20Windows%20app%20using%20VB.NET.%20Aside%20from%201%20or%202%20people%20saying%20%E2%80%9COh%20man%20why%20don%E2%80%99t%20you%20be%20a%20man%20and%20write%20it%20using%20C%23%3F%E2%80%9D%20I%20reckon%20it%E2%80%99s%20a%20good%20idea%20to%20do%20that%20anyway.%20Thanks%20Scott%20for%20the%20suggestio" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.zemna.net/archives/109&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.zemna.net/archives/109&amp;bm_description=Full-Screen+Application&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.zemna.net/archives/109&amp;title=Full-Screen+Application" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.zemna.net/archives/109&amp;title=Full-Screen+Application" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.zemna.net/archives/109" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Full-Screen+Application+-+http://tinyurl.com/yzgl5sq&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.zemna.net/archives/109/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drag &amp; Drop 기능 구현 기초</title>
		<link>http://www.zemna.net/archives/134</link>
		<comments>http://www.zemna.net/archives/134#comments</comments>
		<pubDate>Tue, 28 Apr 2009 00:04:15 +0000</pubDate>
		<dc:creator>zemna</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.zemna.net/133500</guid>
		<description><![CDATA[1. 드래그 해서 전달하려고 하는 클래스 선언 namespace DragTest { public class Class1 { public int a = 0; } } 2. 드래그(Drag) 하려고 하는 항목에 MouseDown 이벤트를 생성하고 이벤트 내부에 드래그 시작을 알리는 함수 구현 using System; using System.Windows.Form; namespace DragTest { public partial class Form2 : Form { public Form2() { InitializeComponent(); } [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F134"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.zemna.net%2Farchives%2F134&amp;source=zemnanet&amp;style=normal&amp;service=TinyURL.com&amp;hashtags=.NET,C%23" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>1. 드래그 해서 전달하려고 하는 클래스 선언</strong></p>
<pre class="brush: csharp;">
namespace DragTest
{
    public class Class1
    {
        public int a = 0;
    }
}
</pre>
<p><strong>2. 드래그(Drag) 하려고 하는 항목에 <span style="color: #0000ff;"><em>MouseDown 이벤트</em></span>를 생성하고 이벤트 내부에 드래그 시작을 알리는 함수 구현</strong></p>
<pre class="brush: csharp;">
using System;
using System.Windows.Form;

namespace DragTest
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void Form2_MouseDown(object sender, MouseEventArgs e)
        {
            this.DoDragDrop(new Class1(), DragDropEffects.Copy);
        }
    }
}
</pre>
<p><strong>3. 드래그한 객체를 받아드릴 컨트롤 또는 폼에 <span style="color: #0000ff;"><em>AllowDrop</em></span> 속성을 True로 설정</strong></p>
<p><strong>4. DragEnter 이벤트 구현</strong></p>
<p><strong>5. DragDrop 이벤트 구현</strong></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-shr">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.zemna.net/archives/134/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.zemna.net/archives/134&amp;title=Drag+%26+Drop+%EA%B8%B0%EB%8A%A5+%EA%B5%AC%ED%98%84+%EA%B8%B0%EC%B4%88" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.zemna.net/archives/134&amp;title=Drag+%26+Drop+%EA%B8%B0%EB%8A%A5+%EA%B5%AC%ED%98%84+%EA%B8%B0%EC%B4%88" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.zemna.net/archives/134&amp;title=Drag+%26+Drop+%EA%B8%B0%EB%8A%A5+%EA%B5%AC%ED%98%84+%EA%B8%B0%EC%B4%88&amp;desc=1.%20%EB%93%9C%EB%9E%98%EA%B7%B8%20%ED%95%B4%EC%84%9C%20%EC%A0%84%EB%8B%AC%ED%95%98%EB%A0%A4%EA%B3%A0%20%ED%95%98%EB%8A%94%20%ED%81%B4%EB%9E%98%EC%8A%A4%20%EC%84%A0%EC%96%B8%0D%0A%0D%0A%5Bcode%20lang%3D%22csharp%22%5D%0D%0Anamespace%20DragTest%0D%0A%7B%0D%0A%20%20%20%20public%20class%20Class1%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20public%20int%20a%20%3D%200%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%5B%2Fcode%5D%0D%0A%0D%0A2.%20%EB%93%9C%EB%9E%98%EA%B7%B8%28Drag%29%20%ED%95%98%EB%A0%A4%EA%B3%A0%20%ED%95%98%EB%8A%94%20%ED%95%AD%EB%AA%A9%EC%97%90%20MouseDown%20%EC%9D%B4%EB%B2%A4%ED%8A%B8%EB%A5%BC%20%EC%83%9D%EC%84%B1%ED%95%98%EA%B3%A0%20%EC%9D%B4%EB%B2%A4%ED%8A%B8%20%EB%82%B4%EB%B6%80%EC%97%90%20%EB%93%9C%EB%9E%98%EA%B7%B8%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.zemna.net/archives/134&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.zemna.net/archives/134&amp;bm_description=Drag+%26+Drop+%EA%B8%B0%EB%8A%A5+%EA%B5%AC%ED%98%84+%EA%B8%B0%EC%B4%88&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.zemna.net/archives/134&amp;title=Drag+%26+Drop+%EA%B8%B0%EB%8A%A5+%EA%B5%AC%ED%98%84+%EA%B8%B0%EC%B4%88" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.zemna.net/archives/134&amp;title=Drag+%26+Drop+%EA%B8%B0%EB%8A%A5+%EA%B5%AC%ED%98%84+%EA%B8%B0%EC%B4%88" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.zemna.net/archives/134" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Drag+%26+Drop+%EA%B8%B0%EB%8A%A5+%EA%B5%AC%ED%98%84+%EA%B8%B0%EC%B4%88+-+http://tinyurl.com/yg96f8s&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.zemna.net/archives/134/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
