IT 이야기2009. 3. 20. 15:59
Silverlight 3 Beta가 MIX09에서 공개되었다. MIX 행사를 직접 보지는 못했지만, 사이트에 올라와 있는 정보를 통해서 어떤 것들이 새롭게 추가되고 바뀌었는지 찾아보았다.

참고 자료 
[MIX09] 조금전 키노트 세션이 끝났습니다. - 올해도 대박! (by 준서아빠가 생각하는 행복한 UX 이야기)


WHAT'S NEW IN SILVERLIGHT 3 BETA?

1. Support for Higher Quality Video & Audio

H.264 / Advanced Audio Coding (AAC) Audio 지원
GPU 하드웨어 가속을 사용한 full-screen HD 지원 (720p+)
- 새로운 Raw AV pipeline을 통한 써드파티 코덱 지원 강화
- AES encryping이나 Windows Media DRM을 이용한 Silverlight DRM 지원


2. Empowering Richer Experiences

- 3D Graphics 지원
- Pixel Shader
- Bitmap Caching
New Bitmap API : Bitmap에 직접 Pixel을 쓰는것이 가능해짐.
- Themed application support : Silverlight 3 어플리케이션의 테마를 설정가능하다.
- Animation Effects : 새로운 효과들이 추가되었음
- Enhanced control skinning
- Improved text rendering & font support : Text 렌더링과 애니메이션의 성능 향상


3. Improving Rich Internet Application Productivity

- 컨트롤들이 많이 추가되었음 (소스코드도 함께 제공)
- Deep Linking 제공 (RIA 안에서의 북마크 가능)
- Search Engine Optimization ?
- Enhanced Data Support 
  • UI 프로퍼티들 사이의 Binding이 가능해짐
  • Data Forms
  • Data validation 컨트롤 제공
  • Support for business objects
- Improved performance
  • 클라이언트에 프레임워크를 캐싱하여 어플리케이션의 사이즈를 줄임. 렌더링 성능 향상을 가져옴
  • Enhanced Deep Zoom
  • Binary XML
  • Local Connection _ 클라이언트에 있는 두개의 Silverlight 어플리케이션의 커뮤니케이션 제공 (without incurring a surver roundtrip)

4. Advanced Accessibility Features




5. Out of Browser Capabilities

- 사용자들이 Silverlight 어플리케이션의 로컬 PC에 설치 할 수 있음. (desktop 바로가기, 시작 메뉴 등록 가능) : 추가 적인 런타임 다룬로드나 브라우저 플러그인이 필요 없음
- 설치된 어플리케이션은 인터넷에 접속이 되어 있지 않아도 실행 가능
- Desktop shortcuts and start menu support
- Safe and secure : Silverlight 어플리케이션은 보안 Sandbox 안에서 동작함 (with persistent isolated storage), 전통적인 웹 어플리케이션과 동일한 보안이 적용됨
- Smooth installation : Silverlight 어플리케이션이 로컬에 cache 되기 때문에 설치 실행에 추가적인 허가가 필요 없음
- Auto Update : Silverlight 어플리케이션은 실행한 다음 자동으로 새로운 버전을 찾고 업데이트 함
- Internet connectivity detection : Silverlight 어플리케이션은 인터넷 접속이 되었는지 되지 않았는지 감지 가능함


추가 적으로 Expression Blend 3 변경 사항이 있는데 내가 Blend를 아직 잘 알고 있지 못하기 때문에 자세히 보지는 않았다. Adobe Photoshop과 Illustrator import라는 항목은 눈에 확 띄긴 하더라.


ps.
회사에서 관심 가질 만한 부분에 대해서는 빨간색으로 표시를 해두었음. 미디어 관련하여 많이 것들이 바뀌었다는 사실이 즐거움
Posted by 알 수 없는 사용자
Tech/Silverlight2009. 3. 19. 00:52
참고 자료 _ Loading Dynamic XAPs and Assemblies

1. What is Assembly?
2. XAP를 다운로드 하기
3. XAP에서 AppManifest.xaml 추출해 내기
4. AppManifest에 정의된 Assembly를 로드하기
5. 로드된 어셈블리에 있는 UserControl 생성하기


1. What is Assembly?


In the Microsoft .NET framework, an assembly is a partially compiled code library for use in deployment, versioning and security

Assembly는 다음과 같은 특징을 가진다.

1. 어셈블리는 코드들의 논리적인 묶음이다.
2. 어셈블리는 물리적으로 DLL또는 EXE로 존재한다.
3. 한 개의 어셈블리는 한 개이상의 파일을 포함할 수 있다.


2. XAP를 다운로드 하기

Silverlight 어플리케이션 내에서 미리 컴파일된 Silverlight Application(.xap)을 불러들이기 위해서는 WebClient를 사용한다. 불러들인 결과물의 타입은 Stream이다.

WebClient c = new WebClient();
c.OpenReadCompleted += new OpenReadCompletedEventHandler(c_OpenReadCompleted);
c.OpenReadAsync(new Uri("DynamicXAPDataGrid.xap", UriKind.Relative));

void c_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
// e.Result를 통해 xap의 Stream을 사용할 수 있다.
}

참고 사항
Silverlight 기반 응용 프로그램을 빌드하면 XAP가 만들어 진다. XAP 파일은 응용 프로그램을 시작하는데 필요한 모든 파일을 포함하는 압축된 ZIP 파일이다.

XAP 파일에는 다음과 같은 파일이 들어 있다.

1. 패키지된 어셈블리 및 응용 프로그램 진입점을 식별하는 AppManifest.xaml 파일 한 개 
2. 응용 프로그램 클래스가 들어 있는 응용 프로그램 어셈블리 한 개 
3. 0개 이상의 라이브러리 어셈블리 
4. 이미지나 비디오 파일 같은 느슨한 리소스 파일 0개 이상 


3. XAP에서 AppManifest.xaml 추출하기 

XAP 파일의 Stream에서 AppManifest.xaml 파일의 내용을 추출하기 위해서는 Application.GetResourceStream을 사용한다. GetResourceStream을 사용하면 지정한 zip 패키지에서 특정한 리소스 파일을 얻을 수 있다. (얻을 수 있는 값은 StreamResourceInfo 타입이다.)

Application.GetResourceStream(new StreamResourceInfo(e.Result, null), new Uri("AppManifest.xaml", UriKind.Relative))

AppManifest.xaml 파일의 StreamResourceInfo를 얻었다면 그 파일의 Stream을 XML 파싱을 위해 String 형태로 변환한다.

string appManifest = new StreamReader(appManifestStreamInfo.Stream).ReadToEnd();

그리고 얻어낸 string을 System.xml.Linq를 이용해 파싱하여 AssemblyPart 부분을 List로 만들어 둔다.

XElement deploy = XDocument.Parse(appManifest).Root;
List<XElement> parts = (from assemblyParts in deploy.Elements().Elements()
select assemblyParts).ToList();

제 사용한 DynamicXAPDataGrid.xap 파일에 포함된 AppManifest.xaml 파일의 내용은 다음과 같다. 이를 살펴보면 이 xap에 포함된 어셈블리가 무엇인지 확인할 수 있다.

<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="DynamicXAPDataGrid" EntryPointType="DynamicXAPDataGrid.App" RuntimeVersion="2.0.31005.0">
  <Deployment.Parts>
    <AssemblyPart x:Name="DynamicXAPDataGrid" Source="DynamicXAPDataGrid.dll" />
    <AssemblyPart x:Name="System.Windows.Controls.Data" Source="System.Windows.Controls.Data.dll" />
    <AssemblyPart x:Name="System.Windows.Controls" Source="System.Windows.Controls.dll" />
    <AssemblyPart Source="ko/System.Windows.Controls.resources.dll" />
    <AssemblyPart Source="ko/System.Windows.Controls.Data.resources.dll" />
  </Deployment.Parts>
</Deployment>


4. AppManifest에 정의된 Assembly를 로드하기

불러들인 Silverlight 어플리케이션을 사용하기 위해서는, XAML 파일에 정의된 Assembly 파일들을 모두 로드해줘야 한다. AppManifest.xaml에서 얻어 둔 Assembly 들의 경로를 참조하여 로드한다. XAP에 포함된 어셈블리를 로드하기 위해서는 AssemblyPart 클래스를 사용한다.

Assembly asm = null;
foreach (XElement xe in parts)
{
string source = xe.Attribute("Source").Value;
AssemblyPart asmPart = new AssemblyPart();
StreamResourceInfo streamInfo = Application.GetResourceStream(
new StreamResourceInfo(e.Result, "application/binary"), new Uri(source, UriKind.Relative));
if (source == "DynamicXAPDataGrid.dll")
{
asm = asmPart.Load(streamInfo.Stream);
}
else
{
asmPart.Load(streamInfo.Stream);
}
}

AssemblyPart들 중에서 실제 Silverlight 어플리케이션인 DynamicXAPDataGrid.dll 파일은 로드를 실행하고 그 Assembly 객체를 변수에 담아둔다.


5. 로드된 어셈블리에 있는 UserControl 생성하기

실제 Silverlight 어플리케이션 Assembly 객체에서 CreateInstance를 호출해 어플리케이션 내에 포함된 UserControl 객체를 생성할 수 있다.

UserControl myControl = asm.CreateInstance("DynamicXAPDataGrid.Page") as UserControl;


'Tech > Silverlight' 카테고리의 다른 글

LINQ (Language Integrated Query)  (0) 2009.04.06
Silverlight with WEB  (0) 2009.03.30
USING STARTUP PARAMETERS WITH SILVERLIGHT  (0) 2009.03.18
HTML BROWSER INTEGRATION  (0) 2009.03.16
Posted by 알 수 없는 사용자