'event'에 해당되는 글 9건

  1. 2009/07/16 2009년 07월 16일 - sunyruru 미투데이 일기장
  2. 2009/05/18 Silverlight – bubbling events (2)
  3. 2009/05/08 Javascript – 이벤트 추가
  4. 2009/02/11 sunyruru의 미투데이 - 2009년 2월 10일
  5. 2009/01/05 [js]브라우저의 오른쪽 상단의 X표시를 누르거나 창을 닫을때 이벤트 잡기! (1)
  6. 2008/05/06 SMTP 서비스가 재시작 시 작동하지 않는 오류
  7. 2008/03/06 드래그 드랍(Drag and Drop) 으로 개체의 정보 다루기
  8. 2007/08/10 엔터키 누르면 특정 버튼 클릭하게 하기 (1)
  9. 2007/07/20 C# Drag & Drop event handling
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일까지의 미투데이 내용입니다.

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


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


Trackback 0 Comment 0

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

2009/05/18 09:37

Silverlight – bubbling events


이번 내용은 실버라이트에서 개체가 중첩되어 있을 때 이벤트가 중첩(버블링, Bubbling)되는 현상을 막기 위한 방법인데요.

두서 없이 작성한 내용이라 저도 무슨 소린지 모르겠네요 - _-;;

중요한 내용은 4~5번 내용을 살펴보시면 이해가 되실거에요.


 

1. XAML 코드

<UserControl x:Class="BubblingEvents.Page"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Width="400" Height="300">

<Grid x:Name="LayoutRoot" Background="White">

    <Grid x:Name="SubPanel" Margin="28,20,33,26" Background="#FF4084CE" Grid.Row="3">

        <Ellipse x:Name="Ellipse1" Margin="47,48,129,43" Stroke="#FF000000">

            <Ellipse.Fill>

                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

                    <GradientStop Color="#FF0D4C07"/>

                    <GradientStop Color="#FF239E16" Offset="1"/>

                </LinearGradientBrush>

            </Ellipse.Fill>

        </Ellipse>

        <Ellipse x:Name="Ellipse2" Margin="146,79,61,43" Stroke="#FF000000">

            <Ellipse.Fill>

                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

                    <GradientStop Color="#FF490B68"/>

                    <GradientStop Color="#FFF56DFD" Offset="1"/>

                </LinearGradientBrush>

            </Ellipse.Fill>

        </Ellipse>

    </Grid>

 

<TextBlock x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top"/>

</Grid>

</UserControl>

 

 

 

 

2. C# Code

 

using System;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Input;

 

namespace BubblingEvents

{

public partial class Page : UserControl

{

private Int16 _sequence = default(Int16);

public Page()

{

InitializeComponent();

 

InitHandlers();

}

 

private void InitHandlers()

{

this.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftClickHandler);

this.SubPanel.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftClickHandler);

this.Ellipse1.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftClickHandler);

this.Ellipse2.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftClickHandler);

}

 

void MouseLeftClickHandler(Object sender, MouseButtonEventArgs e)

{

Trace((sender as FrameworkElement).Name);

}

 

private void Trace(String name)

{

this.Output.Text = String.Format("[{0}] {1}\n{2}", ++_sequence, name, this.Output.Text);

}

}

}

 

3. 버블링이 발생한다

(클릭순서 1. 파란배경, 2 녹색원, 3보라원)

 

 

4. 버블링 제거 코드

Ellipse를 포함하고 있는 Grid의 이벤트에서만 별도로 이벤트를 작성해 준다

 

private void InitHandlers()

{

this.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftClickHandler);

this.SubPanel.MouseLeftButtonDown += new MouseButtonEventHandler(SubPanel_MouseLeftButtonDown);

this.Ellipse1.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftClickHandler);

this.Ellipse2.MouseLeftButtonDown += new MouseButtonEventHandler(MouseLeftClickHandler);

}

 

void SubPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

{

Trace((sender as FrameworkElement).Name);

e.Handled = true;

}

 

 

5. 상위의 개체가 하위의 개체의 이벤트 전달을 막지 않도록 설정

 

IsHitTestVisable 속성을 이용하여 사용자의 마우스나 키보드 등의 입력이 전달되는 것을 막지 않을 수 있다.

 

 

        <Ellipse x:Name="Ellipse2" Margin="146,79,61,43" Stroke="#FF000000" IsHitTestVisible="False">

            <Ellipse.Fill>

                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">

                    <GradientStop Color="#FF490B68"/>

                    <GradientStop Color="#FFF56DFD" Offset="1"/>

                </LinearGradientBrush>

            </Ellipse.Fill>

        </Ellipse>

    </Grid>

 

<TextBlock x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" IsHitTestVisible="False" />

저작자 표시 비영리 변경 금지
이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License

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

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
Silverlight – Host Settings  (0) 2009/05/10
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


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


Trackback 0 Comment 2

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

  1. 2009/05/18 10:40 address edit & del reply

    비밀댓글 입니다

    • BlogIcon 써니루루 2009/05/21 01:25 address edit & del

      호곡 공도님 ㅎㅎ
      전에 배울때 그렇게 배우고 또 대문자를 썼네요~

2009/05/08 21:06

Javascript – 이벤트 추가

 

웹 페이지에서 컨트롤이나 Element에 이벤트를 추가하기 위해 Cross-browser를 고려해야 한다.

이럴 때 다음과 같이 코드를 작성하면 되겠다.

 

if (window.addEventListener)

{

window.addEventListener('click', SomeClass.ClickEventMethod , false);

}

else

{

window.attachEvent('onclick', SomeClass.ClickEventMethod );

}

 

특정 타겟 브라우저로 개발을 하더라도 위와 같이 작업하는 습관은 정말 중요할 것 같다.

저작자 표시 비영리 변경 금지
이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


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


Trackback 0 Comment 0

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

2009/02/11 04:31

sunyruru의 미투데이 - 2009년 2월 10일

  • Microsoft OCS Event Virtual Launch Event가 등록되었네요~ 새로나온 Microsoft의 UC 핵심으로 추진하는 OCS의 R2버전을 시험해볼 수 있습니다~(OCS MICROSOFT R2 EVENT VIRTUAL LAUNCH)2009-02-10 14:23:05

이 글은 sunyruru님의 2009년 2월 10일의 미투데이 내용입니다.

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


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


Trackback 0 Comment 0

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

2009/01/05 11:40

[js]브라우저의 오른쪽 상단의 X표시를 누르거나 창을 닫을때 이벤트 잡기!


창의 오른쪽 상단의 X표시를 누르거나 창을 닫을때 이벤트 잡기
비밀은 onbeforeunload 이벤트 였군요.
아래와 같은 코드 작성시 창을 닫게 되면 아래의 그림이 나타납니다.
==============================================================================
<HTML>
<HEAD>
<SCRIPT>
function closeIt()
  {
    event.returnValue = "푸클클 정말 닫아? 진짜루?";
  }
</SCRIPT>
</HEAD>
<BODY onbeforeunload="closeIt()">
    <a href="http://www.microsoft.com">Click here to navigate to 
        www.microsoft.com</a>
</BODY>
</HTML>

==============================================================================

간단하네요..
까먹지만 않는다면 ㅎㅎ

저작자 표시 비영리 변경 금지
이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


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


Trackback 0 Comment 1

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

  1. 별로 소용이 없을듯.. 2009/06/22 15:54 address edit & del reply

    새로고침 할때도 뜨는군요...

2008/05/06 18:06

SMTP 서비스가 재시작 시 작동하지 않는 오류

SMTP가 재시작될 때 작동하지 않는 오류가 발생할 수 있습니다.


이러한 경우 다음과 같이 kb326740 문서를 확인하고 처리하시면 됩니다.

http://support.microsoft.com/kb/326740




Event ID 418 is logged when you restart the SMTP service

View products that this article applies to.

Article ID : 326740

Last Review : October 25, 2007

Revision : 2.2

This article was previously published under Q326740

Important This article contains information about editing the metabase. Before you edit the metabase, verify that you have a backup copy that you can restore if a problem occurs. For information about how to do this, see the "Configuration Backup/Restore" Help topic in Microsoft Management Console (MMC).

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


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


Trackback 0 Comment 0

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

2008/03/06 15:52

드래그 드랍(Drag and Drop) 으로 개체의 정보 다루기

http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/overview/DataTransferOverviewEX.htm

드래그 드랍 이벤트에 따라 개체에 데이터를 담아 처리할수 있는 DHTML 예제입니다.

쇼핑몰의 쇼핑카트 등에 이용할 방향이 크네요.

소스 내용은 직접 위 링크를 참조하셔서 확인해 주셔야 할 것 같습니다.
이올린에 북마크하기(0) 이올린에 추천하기(0)
크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


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


Trackback 0 Comment 0

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

2007/08/10 14:22

엔터키 누르면 특정 버튼 클릭하게 하기

[Page.GetPostBackEventReference()를 이용한 doPostBack]

 

자바스크립트로 behind code의 메서드를 실행하고 싶은 경우가 있다.


이럴 경우 보통은 스크립트에서 __doPostBack() 메서드를 정의해서 사용하곤 한다. 하지만, 이는 좋지 못한 방법이다.

 

__doPostBack() 메서드는 .net에서 자동 생성하는 부분으로, 개발자가 별도로 작성하여도 바뀔 가능성이 있다. 또한, .net에서 자동으로 생성하지 않는 경우도 발생한다.

 

스크립트로 behind code의 메서드를 실행하고 싶을 때는 아래와 같은 방법을 권한다.

 

<%= Page.GetPostBackEventReference( WebFormButton ) %>

 

이는 postback이 발생하는 WebForm Control을 매개변수로 넘겨주면, 자동으로 __doPostBack()을 생성해 준다.


ex)
[Page.aspx]
btnOne -> HTML Input 컨트롤 - visible

<script language="javascript">
    function btnOneClick()
    {
        <%= Page.GetPostBackEventReference( btnTwo ) %>
    }
</script>

 

<input type="button" onclick="btnOneClick()">

 

[Page.aspx.cs]
btnTwo -> WebForm Button 컨트롤 - invisible

private void btnTwo_Click(...)
{
    ...
}

 

 

[추가사항 1]

onunload 이벤트시 처리하려면, btnTwo를 LinkButton으로 설정한다.

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


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


Trackback 0 Comment 1

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

  1. 홍반장 2009/01/06 14:45 address edit & del reply

    앗! 어디서 많이 보던가다... ㅋㅋㅋ

2007/07/20 14:20

C# Drag & Drop event handling

.net Window form에서 컨트롤을 드래그 드롭하는 예제를 보면서 DragEnter와 DragDrop이벤트를 발췌해서 소개한다.


  /// <summary>
  /// The DragEnter event of the target control fires when the mouse enters
  /// a target control during a drag operation, and is used to determine if a drop
  /// will be allowed over this control.  This generally involves checking the type
  /// of data being dragged, the type of effects allowed (copy, move, etc.),
  /// and potentially the type and/or the specific instance of the source control that
  /// initiated the drag operation.
  ///
  /// This event will fire only if the AllowDrop property of the target control has
  /// been set to true.
  /// </summary>
  /// <param name="sender">The source of the event.</param>
  /// <param name="e">A DragEventArgs that contains the event data.</param>
  private void listBox1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e)
  {
   // Display some information about the DragDrop information in the
   // richTextBox1 control to show some of the information available.
   richTextBox1.Text = "Source Control: " + sourceControl.Name +
    "\r\nSource Control Type: " + sourceControl.GetType().Name +
    "\r\nAllowed Effect: " + e.AllowedEffect +
    "\r\nMouse Button: " + mouseButton.ToString() + "\r\n" +
    "\r\nAvailable Formats:\r\n";

   // Data may be available in more than one format, so loop through
   // all available formats and display them in richTextBox1.
   foreach (string availableFormat in e.Data.GetFormats(true))
   {
    richTextBox1.Text += "\t" + availableFormat + "\r\n";
   }

   // This control will use any dropped data to add items to the listbox.
   // Therefore, only data in a text format will be allowed.  Setting the
   // autoConvert parameter to true specifies that any data that can be
   // converted to a text format is also acceptable.
   if (e.Data.GetDataPresent(DataFormats.Text, true))
   {
    // Some controls in this sample allow both Copy and Move effects.
    // If a Move effect is allowed, this implementation assumes a Move
    // effect unless the CTRL key was pressed, in which case a Copy
    // effect is assumed.  This follows standard DragDrop conventions.
    if ((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move && (e.KeyState & ctrlKey) != ctrlKey)
    {
     // Show the standard Move icon.
     e.Effect = DragDropEffects.Move;
    }
    else
    {
     // Show the standard Copy icon.
     e.Effect = DragDropEffects.Copy;
    }
   }
  }

  /// <summary>
  /// The DragDrop event of the target control fires when a drop actually occurs over
  /// the target control.  This is where the data being dragged is actually processed.
  ///
  /// This event will fire only if the AllowDrop property of the target control has
  /// been set to true.
  /// </summary>
  /// <param name="sender">The source of the event.</param>
  /// <param name="e">A DragEventArgs that contains the event data.</param>
  private void listBox1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
  {

   // Store the data as a string so that it can be accessed from the
   // mnuCopy and mnuMove click events.
   sourceData = e.Data.GetData(DataFormats.Text, true).ToString();

   // If the right mouse button was used, provide a context menu to allow
   // the user to select a DragDrop effect.  The mouseButton is recorded in the
   // MouseDown event of the source control.
   if (mouseButton == MouseButtons.Right)
   {
    // Show a context menu, asking which operation to perform.
    // The ProcessData() call is then made in the click event
    // of the mnuCopy and mnuMove menu items.  Show only those
    // menu items that correspond to an allowed effect.
    mnuCopy.Visible = ((e.AllowedEffect & DragDropEffects.Copy) == DragDropEffects.Copy);
    mnuMove.Visible = ((e.AllowedEffect & DragDropEffects.Move) == DragDropEffects.Move);
    contextMenu1.Show(listBox1, new Point(20,20));
   }
   else
   {
    // Set the deleteSource member field based on the Effect.
    // The Effect is preset in the DragEnter event handler.
    deleteSource = (e.Effect == DragDropEffects.Move);

    // The processing of the data is done in a separate call, since
    // this is also called from the click event of the contextMenu1 items.
    ProcessData();

   }
  }

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


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


Trackback 0 Comment 0

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