본문 바로가기

C#(CSharp)71

Simple and Powerful Debug function public static void TraceMessage(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string sourceFilePath = "", [CallerLineNumber] int sourceLineNumber = 0) { Debug.WriteLine("message: " + message); Debug.WriteLine("member name: " + memberName); Debug.WriteLine("source file path: " + sourceFilePath); Debug.WriteLine("source line number: " + sourceLineNumber); } 2017. 10. 18.
Send mail by GMail public string sendit(string ReciverMail) { MailMessage msg = new MailMessage(); msg.From = new MailAddress("YourMail@gmail.com"); msg.To.Add(ReciverMail); msg.Subject = "Hello world! " + DateTime.Now.ToString(); msg.Body = "hi to you ... :)"; SmtpClient client = new SmtpClient(); client.UseDefaultCredentials = true; client.Host = "smtp.gmail.com"; client.Port = 587; client.EnableSsl = true; clie.. 2017. 8. 7.
BlockingQueue (BlockingCollection) public static BlockingCollection bc = new BlockingCollection(); public static void AddMailWorker(String body, Exception ex) { try { CheckMailBody checkMailBody = new CheckMailBody( body, ex ); bc.Add( checkMailBody ); } catch(Exception e) { CommonLog.ErrorLog( "AddMailWorker", e ); } } public static void StartMailWorker() { Task mailTask = Task.Factory.StartNew( async () => { try { // Consume co.. 2017. 8. 7.
ObservableCollection 바인딩(Binding) ObservableCollection 을 이용해서 Binding 하는 방법에 대해서 소스를 중심으로 알아 보겠습니다. 1.Declare ObservableCollection 모델 Binding Classusing System;using System.ComponentModel;using System.Collections.ObjectModel;using System.Collections.Generic; namespace ObservableCollectionBinding.Binding{ public class OnePersonInfo : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public virtual.. 2015. 4. 8.