SlideShare una empresa de Scribd logo
1 de 45
DllImport "avicap32.dll"            "capCreateCaptureWindow"
static extern int
  string                  int
  int    int    int           int
  int             int

 DllImport "avicap32.dll"
static extern bool
  int
   MarshalAs UnmanagedType          ref string
  int
   MarshalAs UnmanagedType          ref string
  int

// more and more of the same
Manually
Your Managed                   Traditional
                Generated
    Code                      Windows API
               Interop Code
using Windows.Media.Capture;

var         new CameraCaptureUI
                                         new Size

var           await                     CameraCaptureUIMode

if

      var             new BitmapImage
                          await              FileAccessMode
Metro style app
                                                       Language Support
                                                      (CLR, WinJS, CRT)
             Language Projection

               UI       Pickers    Controls   Media
                                                      Web Host (HTML,
                                                      CSS, JavaScript))
 Windows      XAML      Storage    Network     …
Metadata &
Namespace
                     Windows Runtime Core              Runtime Broker


                          Windows Core
Your Managed   Windows
                         Windows 8 API
    Code       Runtime
You already have the skills to build
 Metro style apps with C# and VB
• The relationship between .NET and the Windows
  Runtime
• Using Windows Runtime APIs from C# and Visual
  Basic
• Building Window Runtime Components in C# and
  Visual Basic
C# and Visual Basic influenced
    the Windows Runtime
Using the Windows Runtime
  feels natural and familiar
 from C# and Visual Basic
var         new CameraCaptureUI
                                         new Size

var           await                     CameraCaptureUIMode

if

      var             new BitmapImage
                          await              FileAccessMode
try
{
   var     new CameraCaptureUI
                                 new Size

catch (Exception e)
{
   //Exception handling code
}
                                            ComException
var picker = new FileOpenPicker();
picker.FileTypeFilter.Add("*");
var files = await picker.PickMultipleFilesAsync();
foreach (var file in files)
{
    lbFiles.Items.Add(file.FileName);
}
         PickMultipleFilesOperation PickMultipleFilesAsync();


    public sealed class PickMultipleFilesOperation :
      IAsyncOperation<IReadOnlyList<StorageFile>>, IAsyncInfo
var picker = new FileOpenPicker();
picker.FileTypeFilter.Add("*");
var files = await picker.PickMultipleFilesAsync();
foreach (StorageFile file in files)
{
    lbFiles.Items.Add(file.FileName);
}
                 System.Collections.Generic.IReadOnlyList
                     <Windows.Storage.StorageFile>
var picker = new FileOpenPicker();
picker.FileTypeFilter.Add("*");
var files = await picker.PickMultipleFilesAsync();
foreach (StorageFile file in files)
{
    lbFiles.Items.Add(file.FileName);
}
                 System.Collections.Generic.IReadOnlyList
                 Windows.Foundation.Collections.IVectorView
                     <Windows.Storage.StorageFile>
                     <Windows.Storage.StorageFile>
FileOpenPicker picker = new FileOpenPicker();
picker.FileTypeFilter.Add("*");

StorageFile file = await picker.PickSingleFileAsync();


Windows.Storage.Streams.IInputStream inputStream =
    await file.OpenForReadAsync();


System.IO.Stream stream = inputStream.AsStream();
System.IO.StreamReader reader = new StreamReader(stream);

string contents = reader.ReadToEnd();
internal async void ProtectBytes(byte[] data, BinaryWriter output)
{
   DataProtectionProvider dpp = new DataProtectionProvider();

    IBuffer result = await dpp.ProtectAsync(data.AsBuffer());
    byte[] protectedData;
    int start = 0;
    if (result.TryGetUnderlyingData(out protectedData, out start))
       output.Write(protectedData);
    else
       throw new InvalidOperationException();
}
You can write your own
Windows Runtime components
    in C# or Visual Basic
You should build a Windows Runtime
component when you want your code to
            be used from
         JS, C++, C# and VB
ComVisible(true), Guid("06D7901C-9045-4241-B8A0-39A1AC0F8618")]
public interface IWindowsApiSample
{
    string HelloWorld();
}

[ComVisible(true), [ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(IWindowsApiSample))]
public class WindowsApiSample : IWindowsApiSample
{
    public string HelloWorld() {
         return "Hello, World!";
    }
}
public sealed class MyClassLibrary
{
    public string HelloWorld()
    {
         return "Hello, World!";
    }
}
By adhering to a few simple rules, you can
                   build
a managed Windows Runtime component
   that projects into C++ or JavaScript
Only the public types and members
 in your managed Windows Runtime
component project need to follow the
            simple rules
public sealed class ManagedLibrary
{
    public List<int> GetNumbers()
    {
        List<int> numbers = new List<int>();
        numbers.AddRange(new int[] {0,1,1,2,3});
        return numbers;
    }
}
public sealed class ManagedLibrary
{
    public IList<int> GetNumbers()
    {
        List<int> numbers = new List<int>();
        numbers.AddRange(new int[] {0,1,1,2,3});
        return numbers;
    }
}
private async Task<string> GetTweetTaskAsync()
{
    string url = "http://api.twitter.com/1/statuses/" +
                     "user_timeline.xml?screen_name=bldwin";
    var http = new HttpClient();
    var resp = await http.GetAsync(url);
    var xml = XDocument.Load(resp.Content.ContentReadStream);
    var str = xml.Descendants("text")
                .Select(x => x.Value).First();
    return str;
}
public IAsyncOperation<string> GetTweetAsync()
{
    return AsyncInfoFactory.Create(
               () => this.GetTweetTaskAsync());
}
Visual Studio has built-in support for
               managed
Windows Runtime component projects
You already have the skills to build
 Metro style apps with C# and VB
Influenced by C# and VB

Feels natural and familiar from
     C# and Visual Basic

  Build your own managed
Windows Runtime components
WinRT Holy COw

Más contenido relacionado

La actualidad más candente

#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)Ghadeer AlHasan
 
Solid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSSolid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSRafael Casuso Romate
 
JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8Rafael Casuso Romate
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101ygv2000
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Christian Schneider
 
Gdg dev fest hybrid apps your own mini-cordova
Gdg dev fest hybrid apps  your own mini-cordovaGdg dev fest hybrid apps  your own mini-cordova
Gdg dev fest hybrid apps your own mini-cordovaAyman Mahfouz
 
Lightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT WidgetsLightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT Widgetsmeysholdt
 
9781305078444 ppt ch10
9781305078444 ppt ch109781305078444 ppt ch10
9781305078444 ppt ch10Terry Yoast
 
Thug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientThug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientAngelo Dell'Aera
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java DevelopersYakov Fain
 
Javascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to JavascriptJavascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to JavascriptLivingston Samuel
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
Java Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug ClassJava Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug ClassCODE WHITE GmbH
 
Java script tutorial
Java script tutorialJava script tutorial
Java script tutorialDoeun KOCH
 
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?SegFaultConf
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass SlidesNir Kaufman
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you pownedDinis Cruz
 

La actualidad más candente (20)

#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)#3 (Multi Threads With TCP)
#3 (Multi Threads With TCP)
 
Solid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSSolid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJS
 
JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
 
Dynamic virtual evironments
Dynamic virtual evironmentsDynamic virtual evironments
Dynamic virtual evironments
 
Gdg dev fest hybrid apps your own mini-cordova
Gdg dev fest hybrid apps  your own mini-cordovaGdg dev fest hybrid apps  your own mini-cordova
Gdg dev fest hybrid apps your own mini-cordova
 
Lightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT WidgetsLightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT Widgets
 
9781305078444 ppt ch10
9781305078444 ppt ch109781305078444 ppt ch10
9781305078444 ppt ch10
 
Thug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientThug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclient
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
Javascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to JavascriptJavascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to Javascript
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
Java Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug ClassJava Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug Class
 
Java script tutorial
Java script tutorialJava script tutorial
Java script tutorial
 
JS Event Loop
JS Event LoopJS Event Loop
JS Event Loop
 
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?Andrzej Ludwikowski -  Event Sourcing - co może pójść nie tak?
Andrzej Ludwikowski - Event Sourcing - co może pójść nie tak?
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you powned
 

Destacado

Theatre metaphor
Theatre metaphorTheatre metaphor
Theatre metaphorepgober
 
Our classroom policies
Our classroom policiesOur classroom policies
Our classroom policiesfowler210
 
Medea: Final Light Design
Medea: Final Light DesignMedea: Final Light Design
Medea: Final Light Designepgober
 
FINAL MEDEA LIGHT DESIGN
FINAL MEDEA LIGHT DESIGNFINAL MEDEA LIGHT DESIGN
FINAL MEDEA LIGHT DESIGNepgober
 
Design tools
Design toolsDesign tools
Design toolsepgober
 
Inspirational research medea
Inspirational research medeaInspirational research medea
Inspirational research medeaepgober
 
Medea: Set Design
Medea: Set DesignMedea: Set Design
Medea: Set Designepgober
 
Final collage
Final collageFinal collage
Final collageepgober
 
Angular.JS: Do it right
Angular.JS: Do it rightAngular.JS: Do it right
Angular.JS: Do it rightEugene Zharkov
 
Final Medea Set Design
Final Medea Set DesignFinal Medea Set Design
Final Medea Set Designepgober
 
Medea: elements and principles
Medea: elements and principlesMedea: elements and principles
Medea: elements and principlesepgober
 
How to be a good frontend developer
How to be a good frontend developerHow to be a good frontend developer
How to be a good frontend developerEugene Zharkov
 
Medea: Costume design
Medea: Costume designMedea: Costume design
Medea: Costume designepgober
 
Что там в summary
Что там в summaryЧто там в summary
Что там в summaryEugene Zharkov
 
Mnrega & clotehes as a scenario
Mnrega & clotehes as a scenarioMnrega & clotehes as a scenario
Mnrega & clotehes as a scenariohyderali123
 
Internal appraisal of the firm
Internal appraisal of the firmInternal appraisal of the firm
Internal appraisal of the firmhyderali123
 

Destacado (19)

AngularJS: Good parts
AngularJS: Good partsAngularJS: Good parts
AngularJS: Good parts
 
Theatre metaphor
Theatre metaphorTheatre metaphor
Theatre metaphor
 
Our classroom policies
Our classroom policiesOur classroom policies
Our classroom policies
 
Medea: Final Light Design
Medea: Final Light DesignMedea: Final Light Design
Medea: Final Light Design
 
FINAL MEDEA LIGHT DESIGN
FINAL MEDEA LIGHT DESIGNFINAL MEDEA LIGHT DESIGN
FINAL MEDEA LIGHT DESIGN
 
Design tools
Design toolsDesign tools
Design tools
 
Inspirational research medea
Inspirational research medeaInspirational research medea
Inspirational research medea
 
Medea: Set Design
Medea: Set DesignMedea: Set Design
Medea: Set Design
 
Welcome to Health Managing Group
Welcome to Health Managing GroupWelcome to Health Managing Group
Welcome to Health Managing Group
 
Final collage
Final collageFinal collage
Final collage
 
Angular.JS: Do it right
Angular.JS: Do it rightAngular.JS: Do it right
Angular.JS: Do it right
 
Final Medea Set Design
Final Medea Set DesignFinal Medea Set Design
Final Medea Set Design
 
Medea: elements and principles
Medea: elements and principlesMedea: elements and principles
Medea: elements and principles
 
How to be a good frontend developer
How to be a good frontend developerHow to be a good frontend developer
How to be a good frontend developer
 
Medea: Costume design
Medea: Costume designMedea: Costume design
Medea: Costume design
 
Что там в summary
Что там в summaryЧто там в summary
Что там в summary
 
Mnrega & clotehes as a scenario
Mnrega & clotehes as a scenarioMnrega & clotehes as a scenario
Mnrega & clotehes as a scenario
 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
 
Internal appraisal of the firm
Internal appraisal of the firmInternal appraisal of the firm
Internal appraisal of the firm
 

Similar a WinRT Holy COw

Dot Net Framework
Dot Net FrameworkDot Net Framework
Dot Net Frameworkssa2010
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
Titanium appcelerator my first app
Titanium appcelerator my first appTitanium appcelerator my first app
Titanium appcelerator my first appAlessio Ricco
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedToru Wonyoung Choi
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh Kushwah
 
Александр Краковецкий_Разработка универсальных приложений для Windows Phone 8...
Александр Краковецкий_Разработка универсальных приложений для Windows Phone 8...Александр Краковецкий_Разработка универсальных приложений для Windows Phone 8...
Александр Краковецкий_Разработка универсальных приложений для Windows Phone 8...GeeksLab Odessa
 
WebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleWebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleRobert Nyman
 
Hybrid apps - Your own mini Cordova
Hybrid apps - Your own mini CordovaHybrid apps - Your own mini Cordova
Hybrid apps - Your own mini CordovaAyman Mahfouz
 
Introduction to the New Asynchronous API in the .NET Driver
Introduction to the New Asynchronous API in the .NET DriverIntroduction to the New Asynchronous API in the .NET Driver
Introduction to the New Asynchronous API in the .NET DriverMongoDB
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WAREFermin Galan
 
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development Naresh Kumar
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsDan Wahlin
 
Ajax toolkit framework
Ajax toolkit frameworkAjax toolkit framework
Ajax toolkit frameworkSunil Kumar
 
Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Christopher Bennage
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 

Similar a WinRT Holy COw (20)

Dot Net Framework
Dot Net FrameworkDot Net Framework
Dot Net Framework
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
Titanium appcelerator my first app
Titanium appcelerator my first appTitanium appcelerator my first app
Titanium appcelerator my first app
 
2310 b 03
2310 b 032310 b 03
2310 b 03
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
 
OpenCMIS Part 1
OpenCMIS Part 1OpenCMIS Part 1
OpenCMIS Part 1
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’s
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
 
Александр Краковецкий_Разработка универсальных приложений для Windows Phone 8...
Александр Краковецкий_Разработка универсальных приложений для Windows Phone 8...Александр Краковецкий_Разработка универсальных приложений для Windows Phone 8...
Александр Краковецкий_Разработка универсальных приложений для Windows Phone 8...
 
WebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at GoogleWebRTC & Firefox OS - presentation at Google
WebRTC & Firefox OS - presentation at Google
 
Hybrid apps - Your own mini Cordova
Hybrid apps - Your own mini CordovaHybrid apps - Your own mini Cordova
Hybrid apps - Your own mini Cordova
 
Asp.net
Asp.netAsp.net
Asp.net
 
Introduction to the New Asynchronous API in the .NET Driver
Introduction to the New Asynchronous API in the .NET DriverIntroduction to the New Asynchronous API in the .NET Driver
Introduction to the New Asynchronous API in the .NET Driver
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
 
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development
Introduction to Windows 8 Development
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
 
Ajax toolkit framework
Ajax toolkit frameworkAjax toolkit framework
Ajax toolkit framework
 
Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)Windows 8 JavaScript (Wonderland)
Windows 8 JavaScript (Wonderland)
 
.Net 3.5
.Net 3.5.Net 3.5
.Net 3.5
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 

Más de Eugene Zharkov

Monorepo: React + React Native. React Alicante
Monorepo:  React + React Native. React Alicante Monorepo:  React + React Native. React Alicante
Monorepo: React + React Native. React Alicante Eugene Zharkov
 
Monorepo: React Web & React Native
Monorepo: React Web & React NativeMonorepo: React Web & React Native
Monorepo: React Web & React NativeEugene Zharkov
 
Create React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyCreate React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyEugene Zharkov
 
Build automation with Fastlane
Build automation with FastlaneBuild automation with Fastlane
Build automation with FastlaneEugene Zharkov
 
React Native Animation
React Native AnimationReact Native Animation
React Native AnimationEugene Zharkov
 
React Native: Hurdle Race
React Native: Hurdle RaceReact Native: Hurdle Race
React Native: Hurdle RaceEugene Zharkov
 
Burn your grass with react native
Burn your grass with react nativeBurn your grass with react native
Burn your grass with react nativeEugene Zharkov
 
Фронтенд сказки
Фронтенд сказкиФронтенд сказки
Фронтенд сказкиEugene Zharkov
 
Cycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveCycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveEugene Zharkov
 
Switch to React.js from AngularJS developer
Switch to React.js from AngularJS developerSwitch to React.js from AngularJS developer
Switch to React.js from AngularJS developerEugene Zharkov
 
Mobile applications in a new way with React Native
Mobile applications in a new way with React NativeMobile applications in a new way with React Native
Mobile applications in a new way with React NativeEugene Zharkov
 
Angular 2: Всех переиграл
Angular 2: Всех переигралAngular 2: Всех переиграл
Angular 2: Всех переигралEugene Zharkov
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Eugene Zharkov
 
Как объяснить на платьях процесс разработки?
Как объяснить на платьях процесс разработки?Как объяснить на платьях процесс разработки?
Как объяснить на платьях процесс разработки?Eugene Zharkov
 
SignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsSignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsEugene Zharkov
 
Roslyn compiler as a service
Roslyn compiler as a serviceRoslyn compiler as a service
Roslyn compiler as a serviceEugene Zharkov
 
Creating windows store java script apps
Creating windows store java script appsCreating windows store java script apps
Creating windows store java script appsEugene Zharkov
 
Big Bang Theory of JavaScript Metro Applications
Big Bang Theory of JavaScript Metro ApplicationsBig Bang Theory of JavaScript Metro Applications
Big Bang Theory of JavaScript Metro ApplicationsEugene Zharkov
 
Windows 8 app java script dark side
Windows 8 app java script dark sideWindows 8 app java script dark side
Windows 8 app java script dark sideEugene Zharkov
 

Más de Eugene Zharkov (20)

Monorepo: React + React Native. React Alicante
Monorepo:  React + React Native. React Alicante Monorepo:  React + React Native. React Alicante
Monorepo: React + React Native. React Alicante
 
Monorepo: React Web & React Native
Monorepo: React Web & React NativeMonorepo: React Web & React Native
Monorepo: React Web & React Native
 
Create React Native App vs Expo vs Manually
Create React Native App vs Expo vs ManuallyCreate React Native App vs Expo vs Manually
Create React Native App vs Expo vs Manually
 
Build automation with Fastlane
Build automation with FastlaneBuild automation with Fastlane
Build automation with Fastlane
 
GraphQL and/or REST
GraphQL and/or RESTGraphQL and/or REST
GraphQL and/or REST
 
React Native Animation
React Native AnimationReact Native Animation
React Native Animation
 
React Native: Hurdle Race
React Native: Hurdle RaceReact Native: Hurdle Race
React Native: Hurdle Race
 
Burn your grass with react native
Burn your grass with react nativeBurn your grass with react native
Burn your grass with react native
 
Фронтенд сказки
Фронтенд сказкиФронтенд сказки
Фронтенд сказки
 
Cycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveCycle.js: Functional and Reactive
Cycle.js: Functional and Reactive
 
Switch to React.js from AngularJS developer
Switch to React.js from AngularJS developerSwitch to React.js from AngularJS developer
Switch to React.js from AngularJS developer
 
Mobile applications in a new way with React Native
Mobile applications in a new way with React NativeMobile applications in a new way with React Native
Mobile applications in a new way with React Native
 
Angular 2: Всех переиграл
Angular 2: Всех переигралAngular 2: Всех переиграл
Angular 2: Всех переиграл
 
Angular 2.0: Brighter future?
Angular 2.0: Brighter future?Angular 2.0: Brighter future?
Angular 2.0: Brighter future?
 
Как объяснить на платьях процесс разработки?
Как объяснить на платьях процесс разработки?Как объяснить на платьях процесс разработки?
Как объяснить на платьях процесс разработки?
 
SignalR: Add real-time to your applications
SignalR: Add real-time to your applicationsSignalR: Add real-time to your applications
SignalR: Add real-time to your applications
 
Roslyn compiler as a service
Roslyn compiler as a serviceRoslyn compiler as a service
Roslyn compiler as a service
 
Creating windows store java script apps
Creating windows store java script appsCreating windows store java script apps
Creating windows store java script apps
 
Big Bang Theory of JavaScript Metro Applications
Big Bang Theory of JavaScript Metro ApplicationsBig Bang Theory of JavaScript Metro Applications
Big Bang Theory of JavaScript Metro Applications
 
Windows 8 app java script dark side
Windows 8 app java script dark sideWindows 8 app java script dark side
Windows 8 app java script dark side
 

Último

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Último (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

WinRT Holy COw

  • 1.
  • 2.
  • 3. DllImport "avicap32.dll" "capCreateCaptureWindow" static extern int string int int int int int int int DllImport "avicap32.dll" static extern bool int MarshalAs UnmanagedType ref string int MarshalAs UnmanagedType ref string int // more and more of the same
  • 4. Manually Your Managed Traditional Generated Code Windows API Interop Code
  • 5. using Windows.Media.Capture; var new CameraCaptureUI new Size var await CameraCaptureUIMode if var new BitmapImage await FileAccessMode
  • 6. Metro style app Language Support (CLR, WinJS, CRT) Language Projection UI Pickers Controls Media Web Host (HTML, CSS, JavaScript)) Windows XAML Storage Network … Metadata & Namespace Windows Runtime Core Runtime Broker Windows Core
  • 7. Your Managed Windows Windows 8 API Code Runtime
  • 8. You already have the skills to build Metro style apps with C# and VB
  • 9. • The relationship between .NET and the Windows Runtime • Using Windows Runtime APIs from C# and Visual Basic • Building Window Runtime Components in C# and Visual Basic
  • 10. C# and Visual Basic influenced the Windows Runtime
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. Using the Windows Runtime feels natural and familiar from C# and Visual Basic
  • 18.
  • 19. var new CameraCaptureUI new Size var await CameraCaptureUIMode if var new BitmapImage await FileAccessMode
  • 20.
  • 21.
  • 22. try { var new CameraCaptureUI new Size catch (Exception e) { //Exception handling code } ComException
  • 23. var picker = new FileOpenPicker(); picker.FileTypeFilter.Add("*"); var files = await picker.PickMultipleFilesAsync(); foreach (var file in files) { lbFiles.Items.Add(file.FileName); } PickMultipleFilesOperation PickMultipleFilesAsync(); public sealed class PickMultipleFilesOperation : IAsyncOperation<IReadOnlyList<StorageFile>>, IAsyncInfo
  • 24. var picker = new FileOpenPicker(); picker.FileTypeFilter.Add("*"); var files = await picker.PickMultipleFilesAsync(); foreach (StorageFile file in files) { lbFiles.Items.Add(file.FileName); } System.Collections.Generic.IReadOnlyList <Windows.Storage.StorageFile>
  • 25. var picker = new FileOpenPicker(); picker.FileTypeFilter.Add("*"); var files = await picker.PickMultipleFilesAsync(); foreach (StorageFile file in files) { lbFiles.Items.Add(file.FileName); } System.Collections.Generic.IReadOnlyList Windows.Foundation.Collections.IVectorView <Windows.Storage.StorageFile> <Windows.Storage.StorageFile>
  • 26.
  • 27.
  • 28. FileOpenPicker picker = new FileOpenPicker(); picker.FileTypeFilter.Add("*"); StorageFile file = await picker.PickSingleFileAsync(); Windows.Storage.Streams.IInputStream inputStream = await file.OpenForReadAsync(); System.IO.Stream stream = inputStream.AsStream(); System.IO.StreamReader reader = new StreamReader(stream); string contents = reader.ReadToEnd();
  • 29. internal async void ProtectBytes(byte[] data, BinaryWriter output) { DataProtectionProvider dpp = new DataProtectionProvider(); IBuffer result = await dpp.ProtectAsync(data.AsBuffer()); byte[] protectedData; int start = 0; if (result.TryGetUnderlyingData(out protectedData, out start)) output.Write(protectedData); else throw new InvalidOperationException(); }
  • 30. You can write your own Windows Runtime components in C# or Visual Basic
  • 31. You should build a Windows Runtime component when you want your code to be used from JS, C++, C# and VB
  • 32. ComVisible(true), Guid("06D7901C-9045-4241-B8A0-39A1AC0F8618")] public interface IWindowsApiSample { string HelloWorld(); } [ComVisible(true), [ClassInterface(ClassInterfaceType.None)] [ComDefaultInterface(typeof(IWindowsApiSample))] public class WindowsApiSample : IWindowsApiSample { public string HelloWorld() { return "Hello, World!"; } }
  • 33. public sealed class MyClassLibrary { public string HelloWorld() { return "Hello, World!"; } }
  • 34. By adhering to a few simple rules, you can build a managed Windows Runtime component that projects into C++ or JavaScript
  • 35. Only the public types and members in your managed Windows Runtime component project need to follow the simple rules
  • 36.
  • 37. public sealed class ManagedLibrary { public List<int> GetNumbers() { List<int> numbers = new List<int>(); numbers.AddRange(new int[] {0,1,1,2,3}); return numbers; } }
  • 38. public sealed class ManagedLibrary { public IList<int> GetNumbers() { List<int> numbers = new List<int>(); numbers.AddRange(new int[] {0,1,1,2,3}); return numbers; } }
  • 39. private async Task<string> GetTweetTaskAsync() { string url = "http://api.twitter.com/1/statuses/" + "user_timeline.xml?screen_name=bldwin"; var http = new HttpClient(); var resp = await http.GetAsync(url); var xml = XDocument.Load(resp.Content.ContentReadStream); var str = xml.Descendants("text") .Select(x => x.Value).First(); return str; }
  • 40. public IAsyncOperation<string> GetTweetAsync() { return AsyncInfoFactory.Create( () => this.GetTweetTaskAsync()); }
  • 41. Visual Studio has built-in support for managed Windows Runtime component projects
  • 42.
  • 43. You already have the skills to build Metro style apps with C# and VB
  • 44. Influenced by C# and VB Feels natural and familiar from C# and Visual Basic Build your own managed Windows Runtime components