소스 코드 정리를 파일을 저장시에 자동으로 해주는 Extension.
1. Extension에 가서 설치 후 재시작
2. Option에 가서 2가지 항목 체크
3. 저장 전에 포맷이 맞지 않고 불필요한 lib가 using 되어 있음
4. 저장 후에 자동으로 정리가 됨. :)
출처 : https://www.youtube.com/watch?v=JhxC-K-Eehg
소스 코드 정리를 파일을 저장시에 자동으로 해주는 Extension.
1. Extension에 가서 설치 후 재시작
2. Option에 가서 2가지 항목 체크
3. 저장 전에 포맷이 맞지 않고 불필요한 lib가 using 되어 있음
4. 저장 후에 자동으로 정리가 됨. :)
출처 : https://www.youtube.com/watch?v=JhxC-K-Eehg
블로그에 올릴 소스코드를 언어에 맞게 정리하는 방법을 찾아보았다.^^
Gist 사이트에서 소스파일을 만들고 링크를 건다.
Gist에서 소스코드를 변경하면 같이 변경된다.
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
namespace DataGridViewControl | |
{ | |
public partial class Form1 : Form | |
{ | |
List<Person> _dataSource = null; | |
public Form1() | |
{ | |
InitializeComponent(); | |
this.Load += Form1_Load; | |
this.dataGridView1.SelectionChanged += dataGridView1_SelectionChanged; | |
} | |
void dataGridView1_SelectionChanged(object sender, EventArgs e) | |
{ | |
DataGridView dgv = sender as DataGridView; | |
if (dgv != null && dgv.SelectedRows.Count > 0) | |
{ | |
DataGridViewRow row = dgv.SelectedRows[0]; | |
if (row != null) | |
this.SelectedRowText.Text = row.Cells[0].Value.ToString(); | |
} | |
} | |
void Form1_Load(object sender, EventArgs e) | |
{ | |
List<Person> PersonList = new List<Person>(); | |
PersonList.Add(new Person() { Age = 10, Name = "john", Address = "Seoul" }); | |
PersonList.Add(new Person() { Age = 20, Name = "Alice", Address = "Busan" }); | |
PersonList.Add(new Person() { Age = 30, Name = "Andy", Address = "Daegu" }); | |
PersonList.Add(new Person() { Age = 40, Name = "michel", Address = "Perth" }); | |
PersonList.Add(new Person() { Age = 50, Name = "Welcom", Address = "Sydny" }); | |
_dataSource = PersonList; | |
this.dataGridView1.DataSource = _dataSource; | |
} | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
string SearchWord = searchText.Text; | |
if (!string.IsNullOrEmpty(SearchWord)) | |
{ | |
IEnumerable<Person> searchedDataSource = | |
from person in _dataSource | |
where person.Name == SearchWord | |
select person; | |
try | |
{ | |
this.dataGridView1.DataSource = searchedDataSource.ToList(); | |
} | |
catch (Exception exception) | |
{ | |
MessageBox.Show(exception.Message); | |
} | |
}else | |
{ | |
MessageBox.Show("Please input any word to search"); | |
} | |
} | |
} | |
public class Person | |
{ | |
public int Age { get; set; } | |
public string Name { get; set; } | |
public string Address { get; set; } | |
} | |
} |
아래 사이트를 참고해서 js, css를 Tstory에 추가한다. => http://baram4815.tistory.com/28
<SCRIPT class="brush: js" type=syntaxhighlighter> 코드 </script> 를 html 모드로 변경해서 작성한다.
사용할 언어 타입에 대한 js 파일을 아래 사이트를 참고 =>