'.NET'에 해당되는 글 98건
- 2009/10/21 Windows Service Debugging
- 2009/10/11 ASP.NET 2.0 AJAX - UpdateProgress
- 2009/09/27 Unicode 한글 코드 표
- 2009/07/21 Silverlight - Animation
- 2009/07/20 Silverlight - Media Player Sample (2)
- 2009/07/16 Silverlight + Expression = Visual Kitchen
- 2009/07/15 Silverlight - Network Sample 2
- 2009/07/13 Silverlight - Network Example 1
- 2009/07/03 Silverlight – Custom control
- 2009/06/23 Silverlight Custom control
일반적으로 Visual Studio의 Process Attach를 이용해서 Windows Service를 디버깅하지요.
코드에 아래와 같이 디버그 모드 일 때 Debugger 선택 화면을 보도록 할 수 있습니다.
#if DEBUG
System.Diagnostics.Debugger.Launch();
#endif
참~ 쉽죠잉~
자세한 내용은 아래 링크를 확인해보세요~
http://weblogs.asp.net/paulballard/archive/2005/07/12/419175.aspx
'.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 |
– 이곳에 (http://www.mari.kr/tag/UpdateProgress) UpdatePanel과 같이 사용하는 UpdateProgress 컨트롤에 대한 설명이 정말 잘 되 있더군요.
아래 코드는 위 사이트에서 가져온 내용인데
정말 잘 분석해두셨네요 ㅎㅎ
나중에도 잘 쓸 코드 같습니다.
<asp:UpdateProgress ID="listViewUpdateProgress" AssociatedUpdatePanelID="listViewUpdatePanel" runat="server" DisplayAfter="50">
<ProgressTemplate>
<style type="text/css">
#UpdateProgressTable {
position:absolute;
z-index:100;
top:0px;
margin:0px;
left:0px;
background-color:#FAFAFA;
border-width:0px;
border-style:None;
font-family:"돋움";
filter:progid:DXImageTransform.Microsoft.Shadow(color=#ffffff, Direction=0, Strength=0)alpha(Opacity=60);
}
</style>
<script type="text/javascript">
function UpdateProgressInit() {
var progress = $get("UpdateProgressTable");
if (typeof (progress) == "object") {
progress.style.width = getClientBounds().width;
progress.style.height = getClientBounds().height;
}
}
function CancelAsyncPostBack() {
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm.get_isInAsyncPostBack()) {
prm.abortPostBack();
}
}
function getClientBounds() {
var clientWidth;
var clientHeight;
switch (Sys.Browser.agent) {
case Sys.Browser.InternetExplorer:
clientWidth = document.documentElement.clientWidth;
clientHeight = document.documentElement.clientHeight;
break;
case Sys.Browser.Safari:
clientWidth = window.innerWidth;
clientHeight = window.innerHeight;
break;
case Sys.Browser.Opera:
clientWidth = Math.min(window.innerWidth, document.body.clientWidth);
clientHeight = Math.min(window.innerHeight, document.body.clientHeight);
break;
default: // Sys.Browser.Firefox, etc.
clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
break;
}
returnnewSys.UI.Bounds(0, 0, clientWidth, clientHeight);
}
</script>
<table align="left" id="UpdateProgressTable">
<tr>
<td align="center">
<br/>페이지 변경 중 입니다...
<br/>
<input id="Button2" type="button" value="취소" onclick="CancelAsyncPostBack()" />
</td>
</tr>
</table>
</ProgressTemplate>
</asp:UpdateProgress>
'.NET > ASP.NET' 카테고리의 다른 글
| ASP.NET 2.0 AJAX - UpdateProgress (0) | 2009/10/11 |
|---|---|
| A .NET library for OpenFlashChart control (0) | 2009/03/29 |
| iTunes Data Grid Skin for ASP.NET GridView, ListView Control (0) | 2009/02/02 |
| Apache Mod_Rewrite use as URL_Rewrite in iis 7 (0) | 2009/01/21 |
| ASP.NET on Ruby on Rails (0) | 2008/03/14 |
| ASP.NET 503 서버 사용량이 많습니다. (0) | 2007/11/02 |
Trackback : http://i-ruru.com/trackback/511
-
Subject JIXmall :: ajax
2009/11/24 09:20
JIXmall :: ajax에 대한 정보입니다.
http://www.sql-und-xml.de/unicode-database/hangul-compatibility-jamo.html
가끔은…
이런 것이 필요하답니다. –_ –;;
필요 없으신 분은 패스~?
Hangul Compatibility Jamo - Block: 3130 - 318F
|
Symbol |
Entity-Code |
Codepunkt |
Name |
Kategorie |
NET |
Version |
Bidi |
|
ㄱ |
ㄱ |
12593 |
HANGUL LETTER KIYEOK |
Y |
2.1 |
L | |
|
ㄲ |
ㄲ |
12594 |
HANGUL LETTER SSANGKIYEOK |
Y |
2.1 |
L | |
|
ㄳ |
ㄳ |
12595 |
HANGUL LETTER KIYEOK-SIOS |
Y |
2.1 |
L | |
|
ㄴ |
ㄴ |
12596 |
HANGUL LETTER NIEUN |
Y |
2.1 |
L | |
|
ㄵ |
ㄵ |
12597 |
HANGUL LETTER NIEUN-CIEUC |
Y |
2.1 |
L | |
|
ㄶ |
ㄶ |
12598 |
HANGUL LETTER NIEUN-HIEUH |
Y |
2.1 |
L | |
|
ㄷ |
ㄷ |
12599 |
HANGUL LETTER TIKEUT |
Y |
2.1 |
L | |
|
ㄸ |
ㄸ |
12600 |
HANGUL LETTER SSANGTIKEUT |
Y |
2.1 |
L | |
|
ㄹ |
ㄹ |
12601 |
HANGUL LETTER RIEUL |
Y |
2.1 |
L | |
|
ㄺ |
ㄺ |
12602 |
HANGUL LETTER RIEUL-KIYEOK |
Y |
2.1 |
L | |
|
ㄻ |
ㄻ |
12603 |
HANGUL LETTER RIEUL-MIEUM |
Y |
2.1 |
L | |
|
ㄼ |
ㄼ |
12604 |
HANGUL LETTER RIEUL-PIEUP |
Y |
2.1 |
L | |
|
ㄽ |
ㄽ |
12605 |
HANGUL LETTER RIEUL-SIOS |
Y |
2.1 |
L | |
|
ㄾ |
ㄾ |
12606 |
HANGUL LETTER RIEUL-THIEUTH |
Y |
2.1 |
L | |
|
ㄿ |
ㄿ |
12607 |
HANGUL LETTER RIEUL-PHIEUPH |
Y |
2.1 |
L | |
|
ㅀ |
ㅀ |
12608 |
HANGUL LETTER RIEUL-HIEUH |
Y |
2.1 |
L | |
|
ㅁ |
ㅁ |
12609 |
HANGUL LETTER MIEUM |
Y |
2.1 |
L | |
|
ㅂ |
ㅂ |
12610 |
HANGUL LETTER PIEUP |
Y |
2.1 |
L | |
|
ㅃ |
ㅃ |
12611 |
HANGUL LETTER SSANGPIEUP |
Y |
2.1 |
L | |
|
ㅄ |
ㅄ |
12612 |
HANGUL LETTER PIEUP-SIOS |
Y |
2.1 |
L | |
|
ㅅ |
ㅅ |
12613 |
HANGUL LETTER SIOS |
Y |
2.1 |
L | |
|
ㅆ |
ㅆ |
12614 |
HANGUL LETTER SSANGSIOS |
Y |
2.1 |
L | |
|
ㅇ |
ㅇ |
12615 |
HANGUL LETTER IEUNG |
Y |
2.1 |
L | |
|
ㅈ |
ㅈ |
12616 |
HANGUL LETTER CIEUC |
Y |
2.1 |
L | |
|
ㅉ |
ㅉ |
12617 |
HANGUL LETTER SSANGCIEUC |
Y |
2.1 |
L | |
|
ㅊ |
ㅊ |
12618 |
HANGUL LETTER CHIEUCH |
Y |
2.1 |
L | |
|
ㅋ |
ㅋ |
12619 |
HANGUL LETTER KHIEUKH |
Y |
2.1 |
L | |
|
ㅌ |
ㅌ |
12620 |
HANGUL LETTER THIEUTH |
Y |
2.1 |
L | |
|
ㅍ |
ㅍ |
12621 |
HANGUL LETTER PHIEUPH |
Y |
2.1 |
L | |
|
ㅎ |
ㅎ |
12622 |
HANGUL LETTER HIEUH |
Y |
2.1 |
L | |
|
ㅏ |
ㅏ |
12623 |
HANGUL LETTER A |
Y |
2.1 |
L | |
|
ㅐ |
ㅐ |
12624 |
HANGUL LETTER AE |
Y |
2.1 |
L | |
|
ㅑ |
ㅑ |
12625 |
HANGUL LETTER YA |
Y |
2.1 |
L | |
|
ㅒ |
ㅒ |
12626 |
HANGUL LETTER YAE |
Y |
2.1 |
L | |
|
ㅓ |
ㅓ |
12627 |
HANGUL LETTER EO |
Y |
2.1 |
L | |
|
ㅔ |
ㅔ |
12628 |
HANGUL LETTER E |
Y |
2.1 |
L | |
|
ㅕ |
ㅕ |
12629 |
HANGUL LETTER YEO |
Y |
2.1 |
L | |
|
ㅖ |
ㅖ |
12630 |
HANGUL LETTER YE |
Y |
2.1 |
L | |
|
ㅗ |
ㅗ |
12631 |
HANGUL LETTER O |
Y |
2.1 |
L | |
|
ㅘ |
ㅘ |
12632 |
HANGUL LETTER WA |
Y |
2.1 |
L | |
|
ㅙ |
ㅙ |
12633 |
HANGUL LETTER WAE |
Y |
2.1 |
L | |
|
ㅚ |
ㅚ |
12634 |
HANGUL LETTER OE |
Y |
2.1 |
L | |
|
ㅛ |
ㅛ |
12635 |
HANGUL LETTER YO |
Y |
2.1 |
L | |
|
ㅜ |
ㅜ |
12636 |
HANGUL LETTER U |
Y |
2.1 |
L | |
|
ㅝ |
ㅝ |
12637 |
HANGUL LETTER WEO |
Y |
2.1 |
L | |
|
ㅞ |
ㅞ |
12638 |
HANGUL LETTER WE |
Y |
2.1 |
L | |
|
ㅟ |
ㅟ |
12639 |
HANGUL LETTER WI |
Y |
2.1 |
L | |
|
ㅠ |
ㅠ |
12640 |
HANGUL LETTER YU |
Y |
2.1 |
L | |
|
ㅡ |
ㅡ |
12641 |
HANGUL LETTER EU |
Y |
2.1 |
L | |
|
ㅢ |
ㅢ |
12642 |
HANGUL LETTER YI |
Y |
2.1 |
L | |
|
ㅣ |
ㅣ |
12643 |
HANGUL LETTER I |
Y |
2.1 |
L | |
|
ㅤ |
ㅤ |
12644 |
HANGUL FILLER |
Y |
2.1 |
L | |
|
ㅥ |
ㅥ |
12645 |
HANGUL LETTER SSANGNIEUN |
Y |
2.1 |
L | |
|
ㅦ |
ㅦ |
12646 |
HANGUL LETTER NIEUN-TIKEUT |
Y |
2.1 |
L | |
|
ㅧ |
ㅧ |
12647 |
HANGUL LETTER NIEUN-SIOS |
Y |
2.1 |
L | |
|
ㅨ |
ㅨ |
12648 |
HANGUL LETTER NIEUN-PANSIOS |
Y |
2.1 |
L | |
|
ㅩ |
ㅩ |
12649 |
HANGUL LETTER RIEUL-KIYEOK-SIOS |
Y |
2.1 |
L | |
|
ㅪ |
ㅪ |
12650 |
HANGUL LETTER RIEUL-TIKEUT |
Y |
2.1 |
L | |
|
ㅫ |
ㅫ |
12651 |
HANGUL LETTER RIEUL-PIEUP-SIOS |
Y |
2.1 |
L | |
|
ㅬ |
ㅬ |
12652 |
HANGUL LETTER RIEUL-PANSIOS |
Y |
2.1 |
L | |
|
ㅭ |
ㅭ |
12653 |
HANGUL LETTER RIEUL-YEORINHIEUH |
Y |
2.1 |
L | |
|
ㅮ |
ㅮ |
12654 |
HANGUL LETTER MIEUM-PIEUP |
Y |
2.1 |
L | |
|
ㅯ |
ㅯ |
12655 |
HANGUL LETTER MIEUM-SIOS |
Y |
2.1 |
L | |
|
ㅰ |
ㅰ |
12656 |
HANGUL LETTER MIEUM-PANSIOS |
Y |
2.1 |
L | |
|
ㅱ |
ㅱ |
12657 |
HANGUL LETTER KAPYEOUNMIEUM |
Y |
2.1 |
L | |
|
ㅲ |
ㅲ |
12658 |
HANGUL LETTER PIEUP-KIYEOK |
Y |
2.1 |
L | |
|
ㅳ |
ㅳ |
12659 |
HANGUL LETTER PIEUP-TIKEUT |
Y |
2.1 |
L | |
|
ㅴ |
ㅴ |
12660 |
HANGUL LETTER PIEUP-SIOS-KIYEOK |
Y |
2.1 |
L | |
|
ㅵ |
ㅵ |
12661 |
HANGUL LETTER PIEUP-SIOS-TIKEUT |
Y |
2.1 |
L | |
|
ㅶ |
ㅶ |
12662 |
HANGUL LETTER PIEUP-CIEUC |
Y |
2.1 |
L | |
|
ㅷ |
ㅷ |
12663 |
HANGUL LETTER PIEUP-THIEUTH |
Y |
2.1 |
L | |
|
ㅸ |
ㅸ |
12664 |
HANGUL LETTER KAPYEOUNPIEUP |
Y |
2.1 |
L | |
|
ㅹ |
ㅹ |
12665 |
HANGUL LETTER KAPYEOUNSSANGPIEUP |
Y |
2.1 |
L | |
|
ㅺ |
ㅺ |
12666 |
HANGUL LETTER SIOS-KIYEOK |
Y |
2.1 |
L | |
|
ㅻ |
ㅻ |
12667 |
HANGUL LETTER SIOS-NIEUN |
Y |
2.1 |
L | |
|
ㅼ |
ㅼ |
12668 |
HANGUL LETTER SIOS-TIKEUT |
Y |
2.1 |
L | |
|
ㅽ |
ㅽ |
12669 |
HANGUL LETTER SIOS-PIEUP |
Y |
2.1 |
L | |
|
ㅾ |
ㅾ |
12670 |
HANGUL LETTER SIOS-CIEUC |
Y |
2.1 |
L | |
|
ㅿ |
ㅿ |
12671 |
HANGUL LETTER PANSIOS |
Y |
2.1 |
L | |
|
ㆀ |
ㆀ |
12672 |
HANGUL LETTER SSANGIEUNG |
Y |
2.1 |
L | |
|
ㆁ |
ㆁ |
12673 |
HANGUL LETTER YESIEUNG |
Y |
2.1 |
L | |
|
ㆂ |
ㆂ |
12674 |
HANGUL LETTER YESIEUNG-SIOS |
Y |
2.1 |
L | |
|
ㆃ |
ㆃ |
12675 |
HANGUL LETTER YESIEUNG-PANSIOS |
Y |
2.1 |
L | |
|
ㆄ |
ㆄ |
12676 |
HANGUL LETTER KAPYEOUNPHIEUPH |
Y |
2.1 |
L | |
|
ㆅ |
ㆅ |
12677 |
HANGUL LETTER SSANGHIEUH |
Y |
2.1 |
L | |
|
ㆆ |
ㆆ |
12678 |
HANGUL LETTER YEORINHIEUH |
Y |
2.1 |
L | |
|
ㆇ |
ㆇ |
12679 |
HANGUL LETTER YO-YA |
Y |
2.1 |
L | |
|
ㆈ |
ㆈ |
12680 |
HANGUL LETTER YO-YAE |
Y |
2.1 |
L | |
|
ㆉ |
ㆉ |
12681 |
HANGUL LETTER YO-I |
Y |
2.1 |
L | |
|
ㆊ |
ㆊ |
12682 |
HANGUL LETTER YU-YEO |
Y |
2.1 |
L | |
|
ㆋ |
ㆋ |
12683 |
HANGUL LETTER YU-YE |
Y |
2.1 |
L | |
|
ㆌ |
ㆌ |
12684 |
HANGUL LETTER YU-I |
Y |
2.1 |
L | |
|
ㆍ |
ㆍ |
12685 |
HANGUL LETTER ARAEA |
Y |
2.1 |
L | |
|
ㆎ |
ㆎ |
12686 |
HANGUL LETTER ARAEAE |
Y |
2.1 |
L |
Statistik für den Unicode-Block Hangul Compatibility Jamo
|
C-Id |
C-Name |
Anzahl |
Quote |
|
Lo |
94 |
100 % | |
|
1 Kategorie |
∑ 94 |
|
Version |
Anzahl |
Quote |
|
2.1 |
94 |
100 % |
|
3.0 |
0 |
0 % |
|
3.1 |
0 |
0 % |
|
3.2 |
0 |
0 % |
|
4.0 |
0 |
0 % |
© 2003-2009 Jürgen Auer, Berlin
'.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 |
Silverlight는 애니메이션을 위해 Storyboard를 사용한다.
뭐 Flash와 같은 다른 app.도 마찬가지겠지만 시간에 따라 벡터의 변화를 처리하는 방식이다.
이번 내용은 에제는 포함하지 않겠지만 팁에 해당하는 StoryBoard의 특성값들에 대해 알아본다.
<Storyboard x:Name="TestStoryBoard" FillBehavior="Stop">
애니메이션이 완료 되었을 때 동작을 지정한다.
- HoldEnd(기본값) : 완료 후 오브젝트의 상태 그대로 유지
- Stop : 완료 후 초기 위치로 복원
<Storyboard x:Name="TestStoryBoard" AutoReverse="True">
재생이 완료 되었을 때 원자리로 역 애니메이션으로 돌아온다.
<Storyboard x:Name="TestStoryBoard" SpeedRatio="5.0">
배율로 속도를 지정한다. 위와 같은 경우 평상 속도의 5배로 재생된다.
<Storyboard x:Name="TestStoryBoard" RepeatBehavior="3x">
3회 반복한다. #x를 지정하면 재생 횟수를 지정할 수 있다.
<Storyboard x:Name="TestStoryBoard" RepeatBehavior="Forever">
무한 반복한다.
<Storyboard x:Name="TestStoryBoard" RepeatBehavior="00:00:05.5">
시간을 설정하여 얼마간 재생할지 결정한다.
위 설정은 5.5초
'.NET > Silverlight' 카테고리의 다른 글
| Silverlight - Animation (0) | 2009/07/21 |
|---|---|
| Silverlight - Media Player Sample (2) | 2009/07/20 |
| Silverlight + Expression = Visual Kitchen (0) | 2009/07/16 |
| Silverlight - Network Sample 2 (0) | 2009/07/15 |
| Silverlight - Network Example 1 (0) | 2009/07/13 |
| Silverlight – Custom control (0) | 2009/07/03 |
자료제공 : http://hugeflow.com/
예제소스 :
3-3.WebClientMediaTest.zip |
Silverlight 에서는 정말 쉽게 미디어 플레이어를 만들 수 있는 것 같다.
먼저 silverlight 프로젝트를 하나 만들고, Page.xaml을 blend로 열어준다.
blend에서 asset에 MediaControl 하나를 올려주고 버튼들을 올려 간단히 media 재생에 대한 내용을 작성해보자.
먼저 xaml
<UserControl x:Class="WebClientMediaTest.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="478" d:DesignHeight="337">
<Grid x:Name="LayoutRoot" Background="White">
<MediaElement Margin="0.39,0,-0.39,37" Source="http://hugeflow.com/Metro/Video/pigmap.wmv" x:Name="media"/>
<StackPanel Height="33" Margin="0.39,0,0,0" VerticalAlignment="Bottom" Orientation="Horizontal">
<Button Content="Play" Width="82.333" x:Name="btnPlay" Click="btnPlay_Click"/>
<Button Content="Pause" Width="82.333" x:Name="btnPause" Click="btnPause_Click"/>
<Button Content="Stop" Width="82.333" x:Name="btnStop" Click="btnStop_Click"/>
<Slider Width="216" x:Name="slideVolume" ValueChanged="slideVolume_ValueChanged"/>
</StackPanel>
</Grid>
</UserControl>
다음은 C# 코드
다른 코드들 보다 어쩌먼 정말 간단한 코드같다 -_ -;;using System.Windows;
using System.Windows.Controls;namespace WebClientMediaTest
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();Loaded += new RoutedEventHandler(Page_Loaded);
}void Page_Loaded(object sender, RoutedEventArgs e)
{
slideVolume.Value = slideVolume.Maximum * media.Volume;
}private void btnPlay_Click(object sender, RoutedEventArgs e)
{
media.Play();
}private void btnPause_Click(object sender, RoutedEventArgs e)
{
media.Pause();
}private void btnStop_Click(object sender, RoutedEventArgs e)
{
media.Stop();
}private void slideVolume_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
media.Volume = slideVolume.Value / slideVolume.Maximum;
}
}
}
별다른 기법도 없고, 단지 컨트롤 에서 제공하는 간단한 산수만 한다면 사용할 수 있는..
'.NET > Silverlight' 카테고리의 다른 글
| Silverlight - Animation (0) | 2009/07/21 |
|---|---|
| Silverlight - Media Player Sample (2) | 2009/07/20 |
| Silverlight + Expression = Visual Kitchen (0) | 2009/07/16 |
| Silverlight - Network Sample 2 (0) | 2009/07/15 |
| Silverlight - Network Example 1 (0) | 2009/07/13 |
| Silverlight – Custom control (0) | 2009/07/03 |
http://www.microsoft.com/silverlight/seethelight/
Silverlight 3와 함께 또 흥미로운 녀식이 있었네요.
http://www.microsoft.com/silverlight/seethelight/visualkitchen/default.htm
위 영상을 한번 보세요 ^ ^
'.NET > Silverlight' 카테고리의 다른 글
| Silverlight - Animation (0) | 2009/07/21 |
|---|---|
| Silverlight - Media Player Sample (2) | 2009/07/20 |
| Silverlight + Expression = Visual Kitchen (0) | 2009/07/16 |
| Silverlight - Network Sample 2 (0) | 2009/07/15 |
| Silverlight - Network Example 1 (0) | 2009/07/13 |
| Silverlight – Custom control (0) | 2009/07/03 |
자료제공 : http://hugeflow.com/
2009/04/30 - [.NET/SilverLight] - Silverlight - Network
2009/04/30 - [.NET/SilverLight] - Silverlight - Network Example 1
예제코드 :
3-2.WebServiceTest.zip |
이번에는 이전 내용과 마찬가지이지만 직접 가져오지 않고 웹 서비스를 만들어 데이터를 가져오도록 한다.
먼저 웹서비스의 내용에
/// <summary>
/// WebServiceTest의 요약 설명입니다.
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// ASP.NET AJAX를 사용하여 스크립트에서 이 웹 서비스를 호출하려면 다음 줄의 주석 처리를 제거합니다.
// [System.Web.Script.Services.ScriptService]
public class WebServiceTest : System.Web.Services.WebService
{[WebMethod]
public string HelloWorld()
{
return "Hello World";
}[WebMethod]
public string GetHtml(string address)
{
WebClient wc = new WebClient();
return wc.DownloadString(new Uri(address, UriKind.Absolute));
}
}
다음과 같은 내용을 작성하고,
만약 인코딩 문제로 문자가 깨지는 현상이 발생하면
다음과 같은 코드를 추가해준다.
wc.Encoding = System.Text.Encoding.UTF8;
Silverlight에서는 웹서비스 참조로 위 웹서비스를 추가해준다.
그리고 실버라이트의 Page에 코드를 작성한다..
먼저 Page.xaml 코드
<UserControl x:Class="WebServiceTest.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="485" d:DesignHeight="377">
<Grid x:Name="LayoutRoot" Background="White">
<TextBox Height="47" Margin="8,8,100,0" VerticalAlignment="Top" Text="http://hugeflow.com/sample.xml" TextWrapping="Wrap" x:Name="tboxAddress"/>
<Button HorizontalAlignment="Right" Margin="0,8,8.192,0" VerticalAlignment="Top" Content="Get" Width="88" Height="47" x:Name="buttonGet" Click="buttonGet_Click"/>
<TextBlock Margin="8,59,8,8" Text="" TextWrapping="Wrap" x:Name="tbOutput"/>
</Grid>
</UserControl>
C# 코드
using System;
using System.Windows;
using System.Windows.Controls;namespace WebServiceTest
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}private void buttonGet_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(tboxAddress.Text) == true)
{
return;
}try
{
WebServiceTest.ServiceReference1.WebServiceTestSoapClient wsclient = new WebServiceTest.ServiceReference1.WebServiceTestSoapClient();
wsclient.GetHtmlCompleted += new EventHandler<WebServiceTest.ServiceReference1.GetHtmlCompletedEventArgs>(wsclient_GetHtmlCompleted);
wsclient.GetHtmlAsync(tboxAddress.Text);
}
catch (Exception ex)
{
tbOutput.Text = ex.Message;
}
}void wsclient_GetHtmlCompleted(object sender, WebServiceTest.ServiceReference1.GetHtmlCompletedEventArgs e)
{
if (e.Cancelled == true)
{
tbOutput.Text = "취소되었습니다.";
return;
}if (e.Error != null)
{
if (string.IsNullOrEmpty(e.Error.Message) == false)
{
tbOutput.Text = e.Error.Message;
}
else
{
tbOutput.Text = e.Error.ToString();
}
return;
}tbOutput.Text = e.Result;
}
}
}
이전 예제와 대부분이 비슷한 것을 알 수 있다.
그냥 웹서비스 호출하도로 바꾼내용이니.. ㅎㅎ
'.NET > Silverlight' 카테고리의 다른 글
| Silverlight - Media Player Sample (2) | 2009/07/20 |
|---|---|
| Silverlight + Expression = Visual Kitchen (0) | 2009/07/16 |
| Silverlight - Network Sample 2 (0) | 2009/07/15 |
| Silverlight - Network Example 1 (0) | 2009/07/13 |
| Silverlight – Custom control (0) | 2009/07/03 |
| Silverlight Custom control (0) | 2009/06/23 |
자료제공 : http://hugeflow.com/
3-1.WebClientTest.zip |
이전 내용에 Silverlight의 네트워크에 작성한 내용이 있다.
2009/04/30 - [.NET/SilverLight] - Silverlight - Network
이 내용을 바탕으로 다음의 소스코드를 작성하였으므로 내용의 이해가 조금 부족하면 확인하시길...
예제는 프로젝트명 WebClientTest로 하였고,
먼저 Page.xaml 코드는
<UserControl x:Class="WebClientTest.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="Auto" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="418">
<Grid x:Name="LayoutRoot" Background="White"><TextBox Height="47" Margin="8,8,100,0" VerticalAlignment="Top" Text="http://hugeflow.com/sample.xml" TextWrapping="Wrap" x:Name="tboxAddress"/>
<Button HorizontalAlignment="Right" Margin="0,8,8.192,0" VerticalAlignment="Top" Content="Get" Width="88" Height="47" x:Name="buttonGet" Click="buttonGet_Click"/>
<TextBlock Margin="8,59,8,8" Text="" TextWrapping="Wrap" x:Name="tbOutput"/></Grid>
</UserControl>
다음으로 C# 코드
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;namespace WebClientTest
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}private void buttonGet_Click(object sender, RoutedEventArgs e)
{
if (string.IsNullOrEmpty(tboxAddress.Text) == true)
{
return;
}try
{
WebClient wc = new WebClient();
wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
wc.DownloadStringAsync(new Uri(tboxAddress.Text, UriKind.Absolute));
}
catch (Exception ex)
{
tbOutput.Text = ex.Message;
throw;
}
}void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
if (e.Cancelled == true)
{
tbOutput.Text = "취소되었습니다.";
return;
}if (e.Error != null)
{
if (string.IsNullOrEmpty(e.Error.Message) == false)
{
tbOutput.Text = e.Error.Message;
}
else
{
tbOutput.Text = e.Error.ToString();
}
return;
}tbOutput.Text = e.Result;
}
}
}
'.NET > Silverlight' 카테고리의 다른 글
| Silverlight + Expression = Visual Kitchen (0) | 2009/07/16 |
|---|---|
| Silverlight - Network Sample 2 (0) | 2009/07/15 |
| Silverlight - Network Example 1 (0) | 2009/07/13 |
| Silverlight – Custom control (0) | 2009/07/03 |
| Silverlight Custom control (0) | 2009/06/23 |
| Silverlight – bubbling events (2) | 2009/05/18 |
이번엔 실버라이트 사용자 컨트롤을 만들어봅니다.
설명이 많이 부족하지만 따라하시다보면 성공하실수.....
사실 제가 부족해서 설명이 많이 부족하네요ㅠㅠ
Generic.xaml
-
Custom Control의 기본 모양을 정의하는 파일
-
Xmlns와 xmlns:x는 page.xaml에서 가져온다
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>
public class MyControl : Control
{
public MyControl()
{
this.DefaultStyleKey = typeof(MyControl);
}
}
Control을 상속 받고
기본 스타일 키를 현재 형식의 타입을 지정한다.
재정의할 메소드가 있는데, OnApplyTemplate 을 override 하여 메소드를 만든다
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
}
이제 Generic.xaml에서 내가 작성하는 control의 네임스페이스를 지정한다.
My로 prefix를 주었으므로 my를 앞으로 사용하게 된다
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:CustomControlTest2"
>
<Style TargetType="my:MyControl">
</Style>
</ResourceDictionary>
이제 컨트롤의 템플릿을 만든다
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:CustomControlTest2"
>
<Style TargetType="my:MyControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="my:MyControl">
<Grid>
<TextBlock x:Name="MyText" Text="안녕?" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
이제 기본적인 내용은 끝났고 Grid 안에 내용을 지정한다.
이제 컨트롤에서 속성을 노출할 수 있도록 작성해보자.
propdp를 입력하면 인텔리센스로 작성할 수 있다.
마지막에 UIxxxxxxx(0) 라고 나오는 부분은 지워주고 PropertyMetadata 로 변경해야한다.
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace CustomControlTest2
{
public class MyControl : Control
{
TextBlock _tb = null;
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
// Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register(
"Text",
typeof(string),
typeof(MyControl),
new PropertyMetadata(new PropertyChangedCallback(
// e는 보낸쪽
(d, e) =>
{
MyControl myControl = d as MyControl;
if (myControl != null && myControl._tb != null)
{
myControl._tb.Text = e.NewValue.ToString();
}
})
)
);
public MyControl()
{
this.DefaultStyleKey = typeof(MyControl);
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
// 컨트롤에 들어 있는 TextBlock을 가져온다.
_tb = GetTemplateChild("MyText") as TextBlock;
if (_tb !=null)
{
_tb.Text = "커스텀 컨트롤~!";
}
}
}
}
이제 Page.xaml에 돌아와서 MyControl을 작성해 보자
<UserControl x:Class="CustomControlTest2.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:CustomControlTest2"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<my:MyControl Text="여기에 글을 작성해보자!!"></my:MyControl>
</Grid>
</UserControl>
'.NET > Silverlight' 카테고리의 다른 글
| Silverlight - Network Sample 2 (0) | 2009/07/15 |
|---|---|
| Silverlight - Network Example 1 (0) | 2009/07/13 |
| Silverlight – Custom control (0) | 2009/07/03 |
| Silverlight Custom control (0) | 2009/06/23 |
| Silverlight – bubbling events (2) | 2009/05/18 |
| Silverlight – DispatcherTimer , Clock (0) | 2009/05/12 |
이번에는 Silverlight의 컨트롤을 정의해서 만들어봅니다.
예전에 강의들을 때 작성하고 다시보니 무슨소린지 모르겠네요.. ㅋㅋㅋ
그래도 전혀 무지한 것 보단 캡쳐라도 약간 있으니 ㅠㅠ 나중에 약간이라도 도움될 듯..
부족하지만 1%라도 얻을게 있을지 모르니 정리 안된 상태로 등록합니다... ㅋㅋ
Generic.xaml
-
Custom Control의 기본 모양을 정의하는 파일
-
Xmlns와 xmlns:x는 page.xaml에서 가져온다
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary>
public class MyControl : Control
{
public MyControl()
{
this.DefaultStyleKey = typeof(MyControl);
}
}
Control을 상속 받고
기본 스타일 키를 현재 형식의 타입을 지정한다.
재정의할 메소드가 있는데, OnApplyTemplate 을 override 하여 메소드를 만든다
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
}
이제 Generic.xaml에서 내가 작성하는 control의 네임스페이스를 지정한다.
my로 prefix를 주었으므로 my를 앞으로 사용하게 된다
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:CustomControlTest2"
>
<Style TargetType="my:MyControl">
</Style>
</ResourceDictionary>
이제 컨트롤의 템플릿을 만든다
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:CustomControlTest2"
>
<Style TargetType="my:MyControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="my:MyControl">
<Grid>
<TextBlock x:Name="MyText" Text="안녕?" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
이제 기본적인 내용은 끝났고 Grid 안에 내용을 지정한다.
이제 컨트롤에서 속성을 노출할 수 있도록 작성해보자.
propdp를 입력하면 인텔리센스로 작성할 수 있다.
마지막에 UIxxxxxxx(0) 라고 나오는 부분은 지워주고 PropertyMetadata 로 변경해야한다.
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace CustomControlTest2
{
public class MyControl : Control
{
TextBlock _tb = null;
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
// Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register(
"Text",
typeof(string),
typeof(MyControl),
new PropertyMetadata(new PropertyChangedCallback(
// e는 보낸쪽
(d, e) =>
{
MyControl myControl = d as MyControl;
if (myControl != null && myControl._tb != null)
{
myControl._tb.Text = e.NewValue.ToString();
}
})
)
);
public MyControl()
{
this.DefaultStyleKey = typeof(MyControl);
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
// 컨트롤에 들어 있는 TextBlock을 가져온다.
_tb = GetTemplateChild("MyText") as TextBlock;
if (_tb !=null)
{
_tb.Text = "커스텀 컨트롤~!";
}
}
}
}
이제 Page.xaml에 돌아와서 MyControl을 작성해 보자
<UserControl x:Class="CustomControlTest2.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:CustomControlTest2"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White">
<my:MyControl Text="여기에 글을 작성해보자!!"></my:MyControl>
</Grid>
</UserControl>
'.NET > Silverlight' 카테고리의 다른 글
| Silverlight - Network Example 1 (0) | 2009/07/13 |
|---|---|
| Silverlight – Custom control (0) | 2009/07/03 |
| Silverlight Custom control (0) | 2009/06/23 |
| Silverlight – bubbling events (2) | 2009/05/18 |
| Silverlight – DispatcherTimer , Clock (0) | 2009/05/12 |
| Silverlight – Dynamic Page load (0) | 2009/05/10 |

이올린에 북마크하기
이올린에 추천하기
3-3.WebClientMediaTest.zip


Prev




