Skip to content

Commit a323282

Browse files
authored
Update template.md
1 parent 09964de commit a323282

1 file changed

Lines changed: 51 additions & 25 deletions

File tree

specs/template.md

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
For example, this section is a place to explain why you're adding this
3636
API rather than modifying an existing API.
3737
38-
If you're writing a "converged" API add links into docs.microsoft.com
39-
for the existing Win32 or WinRT APIs that are being converged.
40-
4138
For example, this is a place to provide a brief explanation of some dependent
4239
area, just explanation enough to understand this new API, rather than telling
4340
the reader "go read 100 pages of background information posted at ...".
@@ -49,6 +46,7 @@ In this document we describe the updated API. We'd appreciate your feedback.
4946
# Description
5047
<!-- TEMPLATE
5148
Use this section to provide a brief description of the feature.
49+
5250
For an example, see the introduction to the PasswordBox control
5351
(http://docs.microsoft.com/windows/uwp/design/controls-and-patterns/password-box).
5452
-->
@@ -57,33 +55,50 @@ In this document we describe the updated API. We'd appreciate your feedback.
5755
# Examples
5856
<!-- TEMPLATE
5957
Use this section to explain the features of the API, showing
60-
example code with each description. The general format is:
58+
example code with each description in both C# (for our WinRT API or .NET API) and
59+
in C++ for our COM API. Use snippets of the sample code you wrote for the sample apps.
60+
61+
The general format is:
6162
6263
## FirstFeatureName
6364
6465
Feature explanation text goes here, including why an app would use it, how it
6566
replaces or supplements existing functionality.
6667
6768
```c#
68-
void SampleMethod() {
69+
void SampleMethod()
70+
{
6971
var show = new AnExampleOf();
7072
show.SomeMembers = AndWhyItMight(be, interesting)
7173
}
7274
```
75+
76+
```cpp
77+
void SampleClass::SampleMethod()
78+
{
79+
winrt::com_ptr<ICoreWebView2> webview2 = ...
80+
}
81+
```
7382
7483
## SecondFeatureName
7584
7685
Feature explanation text goes here, including why an app would use it, how it
7786
replaces or supplements existing functionality.
7887
7988
```c#
80-
void SampleMethod() {
89+
void SampleMethod()
90+
{
8191
var show = new AnExampleOf();
8292
show.SomeMembers = AndWhyItMight(be, interesting)
8393
}
8494
```
85-
86-
Code samples should be in C# and/or C++/WinRT.
95+
96+
```cpp
97+
void SampleClass::SampleMethod()
98+
{
99+
winrt::com_ptr<ICoreWebView2> webview2 = ...
100+
}
101+
```
87102
88103
As an example of this section, see the Examples section for the PasswordBox
89104
control (https://docs.microsoft.com/windows/uwp/design/controls-and-patterns/password-box#examples).
@@ -116,28 +131,39 @@ In this document we describe the updated API. We'd appreciate your feedback.
116131

117132
# API Details
118133
<!-- TEMPLATE
119-
The exact API, in MIDL3 format (https://docs.microsoft.com/en-us/uwp/midl-3/)
120-
when possible, or in C# if starting with an API sketch. GitHub's markdown
121-
syntax formatter does not (yet) know about MIDL3, so use ```c# instead even
122-
when writing MIDL3.
134+
The exact API, in IDL format for our COM API and
135+
in MIDL3 format (https://docs.microsoft.com/en-us/uwp/midl-3/)
136+
when possible, or in C# if starting with an API sketch for our .NET and WinRT API.
137+
138+
Include every new or modified type but use // ... to remove any methods,
139+
properties, or events that are unchanged.
140+
141+
(GitHub's markdown syntax formatter does not (yet) know about MIDL3, so
142+
use ```c# instead even when writing MIDL3.)
123143
124144
Example:
145+
146+
```
147+
/// Event args for the NewWindowRequested event. The event is fired when content
148+
/// inside webview requested to open a new window (through window.open() and so on.)
149+
[uuid(34acb11c-fc37-4418-9132-f9c21d1eafb9), object, pointer_default(unique)]
150+
interface ICoreWebView2NewWindowRequestedEventArgs : IUnknown
151+
{
152+
// ...
153+
154+
/// Window features specified by the window.open call.
155+
/// These features can be considered for positioning and sizing of
156+
/// new webview windows.
157+
[propget] HRESULT WindowFeatures([out, retval] ICoreWebView2WindowFeatures** windowFeatures);
158+
}
159+
```
125160
126161
```c# (but really MIDL3)
127-
namespace Microsoft.AppModel
162+
public class CoreWebView2NewWindowRequestedEventArgs
128163
{
129-
/// Represents a package on the host system. See Windows.ApplicationModel.Package for more details
130-
runtimeclass Package
131-
{
132-
/// Returns the current package, or null if the current process is not packaged
133-
static Package Current { get; };
134-
135-
/// Returns the package from the system store with this full name or null if not found
136-
static Package GetFromFullName(String fullName);
137-
138-
/// Returns packages in the given family, by name
139-
static Package[] FindByFamilyName(String familyName);
140-
}
164+
// ...
165+
166+
public CoreWebView2WindowFeatures WindowFeatures { get; }
141167
}
142168
```
143169
-->

0 commit comments

Comments
 (0)