SlideShare a Scribd company logo
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

More Related Content

What's hot

#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 & NestJS
Rafael 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 V8
Rafael Casuso Romate
 
JavaScript 101
JavaScript 101JavaScript 101
JavaScript 101
ygv2000
 
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
Christian 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-cordova
Ayman Mahfouz
 
Lightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT WidgetsLightweight Xtext Editors as SWT Widgets
Lightweight Xtext Editors as SWT Widgets
meysholdt
 
9781305078444 ppt ch10
9781305078444 ppt ch109781305078444 ppt ch10
9781305078444 ppt ch10
Terry Yoast
 
Thug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclientThug: a new low-interaction honeyclient
Thug: a new low-interaction honeyclient
Angelo Dell'Aera
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
Yakov Fain
 
Javascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to JavascriptJavascript session 01 - Introduction to Javascript
Javascript session 01 - Introduction to Javascript
Livingston Samuel
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
Thibaud 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 Class
CODE WHITE GmbH
 
Java script tutorial
Java script tutorialJava script tutorial
Java script tutorial
Doeun KOCH
 
JS Event Loop
JS Event LoopJS Event Loop
JS Event Loop
Saai Vignesh P
 
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
 
JavaScript
JavaScriptJavaScript
JavaScript
Reem Alattas
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
Nir 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 powned
Dinis Cruz
 

What's hot (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
 

Viewers also liked

AngularJS: Good parts
AngularJS: Good partsAngularJS: Good parts
AngularJS: Good parts
Eugene Zharkov
 
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 right
Eugene 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 developer
Eugene Zharkov
 
Medea: Costume design
Medea: Costume designMedea: Costume design
Medea: Costume designepgober
 
Что там в summary
Что там в summaryЧто там в summary
Что там в summary
Eugene Zharkov
 
Mnrega & clotehes as a scenario
Mnrega & clotehes as a scenarioMnrega & clotehes as a scenario
Mnrega & clotehes as a scenariohyderali123
 
Elm: give it a try
Elm: give it a tryElm: give it a try
Elm: give it a try
Eugene Zharkov
 
Internal appraisal of the firm
Internal appraisal of the firmInternal appraisal of the firm
Internal appraisal of the firmhyderali123
 

Viewers also liked (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 to WinRT Holy COw

Dot Net Framework
Dot Net FrameworkDot Net Framework
Dot Net Framework
ssa2010
 
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 app
Alessio 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 Extended
Toru Wonyoung Choi
 
OpenCMIS Part 1
OpenCMIS Part 1OpenCMIS Part 1
OpenCMIS Part 1
Alfresco Software
 
Yogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh kumar kushwah represent’s
Yogesh kumar kushwah represent’sYogesh Kushwah
 
Csharp dot net
Csharp dot netCsharp dot net
Csharp dot net
Revanth Mca
 
Александр Краковецкий_Разработка универсальных приложений для 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 Cordova
Ayman 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 framework
Sunil 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 to 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
 

More from 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 Native
Eugene 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 Manually
Eugene Zharkov
 
Build automation with Fastlane
Build automation with FastlaneBuild automation with Fastlane
Build automation with Fastlane
Eugene Zharkov
 
GraphQL and/or REST
GraphQL and/or RESTGraphQL and/or REST
GraphQL and/or REST
Eugene Zharkov
 
React Native Animation
React Native AnimationReact Native Animation
React Native Animation
Eugene Zharkov
 
React Native: Hurdle Race
React Native: Hurdle RaceReact Native: Hurdle Race
React Native: Hurdle Race
Eugene Zharkov
 
Burn your grass with react native
Burn your grass with react nativeBurn your grass with react native
Burn your grass with react native
Eugene Zharkov
 
Фронтенд сказки
Фронтенд сказкиФронтенд сказки
Фронтенд сказки
Eugene Zharkov
 
Cycle.js: Functional and Reactive
Cycle.js: Functional and ReactiveCycle.js: Functional and Reactive
Cycle.js: Functional and Reactive
Eugene 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 developer
Eugene 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 Native
Eugene 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
 

More from 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
 

Recently uploaded

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 

Recently uploaded (20)

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 

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