내 wpf 응용 프로그램에 사용자 정의 드래그 앤 드롭 커서를 포함하여 검색했습니다. 나는 (이 코멘트와 함께 강조)에서 제안 된 코드 한 줄의 아무 생각이없는 article으로 돌아가 셨습니다 :GetManifestResourceStream - 어떻게 캐싱을 도와 줄 수 있습니까?
private void textBlock2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
TextBlock btn = (TextBlock)sender;
GiveFeedbackEventHandler handler = new GiveFeedbackEventHandler(DragSource_GiveFeedback);
btn.GiveFeedback += handler;
DataObject dataObj = new DataObject(btn.Text);
DragDrop.DoDragDrop(btn, dataObj, DragDropEffects.Move);
btn.GiveFeedback -= handler;
}
void DragSource_GiveFeedback(object sender, GiveFeedbackEventArgs e)
{
try
{
if (_allOpsCursor == null)
{
////////////////////////////////////////THE UNKOWN ONE LINE STARTS HERE
using (Stream cursorStream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("SimplestDragDrop.DDIcon.cur")) // AND ENDS HERE
{
_allOpsCursor = new Cursor(cursorStream);
}
}
Mouse.SetCursor(_allOpsCursor);
e.UseDefaultCursors = false;
e.Handled = true;
}
finally { }
}
내가 GetManifestResourceStream 체크를하지만 난 여전히 mainfest 자원이 무엇인지 모른다 어떻게 처리 할 수 있고이 캐싱 아이디어 (주요 기사에서 언급 했음)를 작동시킬 수있는 곳을 시작할 수 있습니다.