'Unit'에 해당되는 글 2건

  1. 2009/07/16 2009년 07월 16일 - sunyruru 미투데이 일기장
  2. 2009/05/14 C# : Unit Class - File Size
2009/07/16 11:37

2009년 07월 16일 - sunyruru 미투데이 일기장

  • OCS의 DMessengerEvents::OnContactStatusChange (http://msdn.microsoft.com/en-us/library/bb758796.aspx) . Scriptable 이라고 써있으니 스크립트에서 처리가능해야 하는데 왜 안되냐..ㅡㅡ(me2DC Microsoft,OCS,Communicator,API,UC,OnContactStatusChange,DMessengerEvents)2009-07-08 16:06:25
  • 자바스크립트 유용한 함수들을 잘 정리해둔 사이트를 찾았당… 유후~ 나중에도 쓸만한 내용이 많겠군.. 훗~(me2DC 자바스크립트,javascript,함수,사이트,webtoolkit)2009-07-14 19:19:55
  • 브라우져의 주소 부분에 javascript:var w=window.document;var p=w.plugins;for(var i in w)w.writeln(i+“=”+eval('w.'+i)+“<br/>”); 이렇게 실행하면 document개체의 값을 볼 수 있네요.(me2DC javascript,자바스크립트,window,document,개체,덤프,dump)2009-07-15 10:12:29
  • 아오.. C++ ATL COM 개체에서 받은 이벤트를 어떻게 JavaScript로 콜백해줘야 하는거냐 ㅠㅠ어렵다 제기랄…(me2DC C++,ATL,COM,ActiveX,Javascript,자바스크립트,CallBack,콜백,이벤트,Event,Internet Explorer)2009-07-15 14:47:00
  • 우리 진상.. 얼마나 피곤했으면 신입이 한시간을 라커룸에서 업무시간에 잤을까 -_ -;; 그래도 조심해야지 신입인데.. 조심좀 해~(me2DC 진상,신입,미쳤어,잠)2009-07-15 16:48:19
  • Silverlight 2 Unit Test를 .net계의 멋진 행님 스캇 구슬이 님이 만드셨나부다. Visual Studio랑 연계도 되고.. Silverlight 2.0 용으로 브라우져에서 GUI 환경으로 유닛 테스트가 되니 꽤 좋은것 같다…(me2DC Silverlight,스캇구스리,Visual studio,유닛테스트,Unit Test)2009-07-15 20:08:39

이 글은 sunyruru님의 2009년 7월 8일에서 2009년 7월 15일까지의 미투데이 내용입니다.

크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/476 관련글 쓰기

2009/05/14 23:51

C# : Unit Class - File Size

 

이전에 올렸던 Length 단위에 이어 두번째 File Size 관련된 단위입니다.

귀찮았는데 막상 파일사이즈를 보여야 할 일이 있어서

간단히 Property 를 이용해서 작성해 봤네요.

C# 프로퍼티(Property)의  가장 적절한 예가 아닌가 생각됩니다. ㅋㅋㅋ



    class FileSize

    {

        public enum UNITS { B, KB, MB, GB, TB }

 

        double b = 0;

        double kb = 0;

        double mb = 0;

        double gb = 0;

        double tb = 0;

 

        public double B

        {

            get

            {

                return this.b;

            }

            set

            {

                this.b = value;

                this.kb = this.b / 1024;

                this.mb = this.kb / 1024;

                this.gb = this.mb / 1024;

                this.tb = this.gb / 1024;

            }

        }

 

        public double KB

        {

            get

            {

                return this.kb;

            }

            set

            {

                this.kb = value;

                this.B = this.kb * 1024;

            }

        }

 

        public double MB

        {

            get

            {

                return this.mb;

            }

            set

            {

                this.mb = value;

                this.KB = this.mb * 1024;

            }

        }

 

        public double GB

        {

            get

            {

                return this.gb;

            }

            set

            {

                this.gb = value;

                this.MB = this.gb * 1024;

            }

        }

 

        public double TB

        {

            get

            {

                return this.tb;

            }

            set

            {

                this.tb = value;

                this.GB = this.tb * 1024;

            }

        }

 

        public FileSize(double size)

        {

            this.B = size;

        }

 

        public override string ToString()

        {

            string ret = string.Empty;

 

            if (b < 1024D)

            {

                ret = string.Format("{0}{1}", b, UNITS.B.ToString());

            }

            else if (kb < 1024D)

            {

                ret = string.Format("{0}{1}", kb, UNITS.KB.ToString());

            }

            else if (mb < 1024D)

            {

                ret = string.Format("{0}{1}", mb, UNITS.MB.ToString());

            }

            else if (gb < 1024D)

            {

                ret = string.Format("{0}{1}", gb, UNITS.GB.ToString());

            }

            else

            {

                ret = string.Format("{0}{1}", tb, UNITS.TB.ToString());

            }

 

            return ret;

        }

    }

 


저작자 표시 비영리 변경 금지
크리에이티브 커먼즈 라이선스
Creative Commons License

'.NET > C#' 카테고리의 다른 글

Windows Service Debugging  (0) 2009/10/21
Unicode 한글 코드 표  (0) 2009/09/27
C# : Unit Class - File Size  (0) 2009/05/14
Memory usage of current thread on C# windows form app.  (0) 2009/04/23
C# : TextBox Auto Scrolling  (2) 2009/04/20
Better string.IsNullOrEmpty() ? How to do C#.NET 3.0  (0) 2009/04/14
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/468 관련글 쓰기